rest_delete_revision

动作钩子
do_action( 'rest_delete_revision', $result, $request )
参数
  • (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.
    Required:
  • (WP_REST_Request) $request The request sent to the API.
    Required:
定义位置
相关勾子
rest_prepare_revisionwp_delete_post_revisionrest_delete_userrest_delete_commentwp_restore_post_revision
相关方法
wp_delete_post_revisionwp_restore_post_revisionrest_ensure_responsewp_list_post_revisionsdelete_transientdelete_option
引入
4.7.0
弃用
-

rest_delete_revision – 当通过WordPress REST API删除一个修订版(一个文章或页面的早期版本)时,这个钩子被调用。开发人员可以使用这个钩子来执行额外的动作,比如当一个修订版被删除时发送通知或更新网站的另一部分。

在通过REST API删除一个修订版后,立即触发。

do_action( 'rest_delete_revision', $result, $request );

常见问题

FAQs
查看更多 >