rest_after_insert_category
Fires after a single term is completely created or updated via the REST API.
This is one of the variants of the dynamic hook rest_after_insert_(taxonomy)
Usage
add_action( 'rest_after_insert_category', 'wp_kama_rest_after_insert_category_action', 10, 3 ); /** * Function for `rest_after_insert_category` action-hook. * * @param WP_Term $term Inserted or updated term object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a term, false when updating. * * @return void */ function wp_kama_rest_after_insert_category_action( $term, $request, $creating ){ // action... }
- $term(WP_Term)
- Inserted or updated term object.
- $request(WP_REST_Request)
- Request object.
- $creating(true|false)
- True when creating a term, false when updating.
Changelog
Since 5.0.0 | Introduced. |
Where the hook is called
rest_after_insert_category
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php 594
do_action( "rest_after_insert_{$this->taxonomy}", $term, $request, true );