rest_delete_(taxonomy)
Fires after a single term is deleted via the REST API.
The dynamic portion of the hook name, $this->taxonomy, refers to the taxonomy slug.
Possible hook names include:
Usage
add_action( 'rest_delete_(taxonomy)', 'wp_kama_rest_delete_taxonomy_action', 10, 3 ); /** * Function for `rest_delete_(taxonomy)` action-hook. * * @param WP_Term $term The deleted term. * @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_taxonomy_action( $term, $response, $request ){ // action... }
- $term(WP_Term)
- The deleted term.
- $response(WP_REST_Response)
- The response data.
- $request(WP_REST_Request)
- The request sent to the API.
Changelog
Since 4.7.0 | Introduced. |
Where the hook is called
rest_delete_(taxonomy)
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php 796
do_action( "rest_delete_{$this->taxonomy}", $term, $response, $request );
wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php 398
do_action( "rest_delete_{$this->taxonomy}", $term, $response, $request );