rest_delete_revision
Fires after a revision is deleted via the REST API.
Usage
add_action( 'rest_delete_revision', 'wp_kama_rest_delete_revision_action', 10, 2 );
/**
* Function for `rest_delete_revision` action-hook.
*
* @param WP_Post|false|null $result The revision object (if it was deleted or moved to the Trash successfully) or false or null (failure). If the revision was moved to the Trash, $result represents its new state; if it was deleted, $result represents its state before deletion.
* @param WP_REST_Request $request The request sent to the API.
*
* @return void
*/
function wp_kama_rest_delete_revision_action( $result, $request ){
// action...
}
- $result(WP_Post|false|null)
- The revision object (if it was deleted or moved to the Trash successfully) or false or null (failure). If the revision was moved to the Trash, $result represents its new state; if it was deleted, $result represents its state before deletion.
- $request(WP_REST_Request)
- The request sent to the API.
Changelog
| Since 4.7.0 | Introduced. |
Where the hook is called
rest_delete_revision
wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php 535
do_action( 'rest_delete_revision', $result, $request );