rest_delete_revision WordPress Action Hook

The rest_delete_revision hook is called when a revision is deleted via the REST API. This hook allows you to take action when a revision is deleted. For example, you might want to log the action or send an email notification.

do_action( 'rest_delete_revision', WP_Post|false|null $result, WP_REST_Request $request ) #

Fires after a revision is deleted via the REST API.


Parameters

$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.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.