Version User Scope of changes
Oct 29 2008, 4:26 PM EDT (current) superwomyn 1 word added, 1 word deleted
Jun 2 2008, 7:34 PM EDT DevinCanterberry 2 words added

Changes

Key:  Additions   Deletions
boolean WPCAPI.onpagecreate()
This method is overloadableoverridable and should not be called directly.

This event is fired whenever a user attempts to create a page, but before the page is allowed to be created. By default, this method simply allows the creation to occur.

Parameters
StringparentIDThe identifier for the parent cell.Required
StringtitleThe title of the new cell.Required
String []tagsThe keyword tags for the new cell.Defaults to []
StringcellIDThe identifier of the new cell.Required
StringcellURLThe URL associated with the new cell.Required
Returns true if the creation is allowed, false otherwise.

Usage:

Asynchronous
if( window.WPCAPI ) {
WPCAPI.onpagecreate = function( parentID, title, tags, cellID, cellURL ) {

var params =
"?parentID=" + encodeURIComponent(parentID)
+ "&title=" + encodeURIComponent(title)
+ "&tags=" + encodeURIComponent(tags)
+ "&cellID=" + encodeURIComponent(cellID)
+ "&cellURL=" + encodeURIComponent(cellURL);

var request = new XMLHttpRequest();
request.open( "POST", "
/path/to/addPage" );
request.onreadystatechange = function() {

if( request.readyState == 4 )
WPCAPI.onpagecreate_Callback( request.status == 200, request.statusText );
};
request.send(params);

return null;

};
}