rest_pre_insert_(taxonomy) filter-hook . WP 4.7.0
Filters term data before inserting term via the REST API.
The dynamic portion of the hook name, $this->taxonomy, refers to the taxonomy slug.
Usage
add_filter( 'rest_pre_insert_(taxonomy)', 'filter_function_name_8792', 10, 2 ); function filter_function_name_8792( $prepared_term, $request ){ // filter... return $prepared_term; }
- $prepared_term(object)
- Term object.
- $request(WP_REST_Request)
- Request object.
Changelog
Since 4.7.0 | Introduced. |
Where the hook is called
rest_pre_insert_(taxonomy)
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php 769
return apply_filters( "rest_pre_insert_{$this->taxonomy}", $prepared_term, $request );