rest_delete_revision
Fires after a revision is deleted via the REST API.
Description
Parameters (2)
- 0. $result ((mixed))
- The revision object (if it was deleted or moved to the trash successfully) or false (failure). If the revision was moved to to the trash,
$result
represents its new state; if it was deleted,$result
represents its state before deletion. - 1. $request (WP_REST_Request)
- The request sent to the API.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'rest_delete_revision', $result, $request );
- The following example is for adding a hook callback.
- // define the rest_delete_revision callback
- function action_rest_delete_revision( $result, $request ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'rest_delete_revision', 'action_rest_delete_revision', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'rest_delete_revision', 'action_rest_delete_revision', 10, 2 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
- do_action( 'rest_delete_revision', $result, $request );