WPCAPI.onpagerestore |

Version 9 - view current page


boolean WPCAPI.onpagerestore()
This method is overloadable and should not be called directly.

This event is fired whenever a user attempts to restore a deleted page, but before the page is allowed to be restored. By default, this method simply allows the restoration to occur.

Parameters
StringcellIDThe identifier for the cell being restored.Required
StringmessageThe edit note entered by the user.Defaults to ""
Returns true if the restoration is allowed, false otherwise.

Usage:

Asynchronous
if( window.WPCAPI ) {
WPCAPI.onpagerestore = function( cellID, message ) {

var params ="cellID="
+ encodeURIComponent(cellID)
+ "&message=" + encodeURIComponent(message);

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

if( request.readyState == 4 )
WPCAPI.onpagerestore_Callback( request.status == 200 );
};
request.send(params);

return null;

};
}