rest_delete_(post_type) хук-событиеWP 4.7.0

Fires immediately after a single post is deleted or trashed via the REST API.

They dynamic portion of the hook name, $this->post_type, refers to the post type slug.

Possible hook names include:


add_action( 'rest_delete_(post_type)', 'wp_kama_rest_delete_post_type_action', 10, 3 );

 * Function for `rest_delete_(post_type)` action-hook.
 * @param WP_Post          $post     The deleted or trashed post.
 * @param WP_REST_Response $response The response data.
 * @param WP_REST_Request  $request  The request sent to the API.
 * @return void
function wp_kama_rest_delete_post_type_action( $post, $response, $request ){

	// action...
The deleted or trashed post.
The response data.
The request sent to the API.

Список изменений

С версии 4.7.0 Введена.

Где вызывается хук

wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1095
do_action( "rest_delete_{$this->post_type}", $post, $response, $request );

Где используется хук в WordPress

Использование не найдено.