rest_pre_insert_(taxonomy) хук-фильтр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.

Possible hook names include:


add_filter( 'rest_pre_insert_(taxonomy)', 'wp_kama_rest_pre_insert_taxonomy_filter', 10, 2 );

 * Function for `rest_pre_insert_(taxonomy)` filter-hook.
 * @param object          $prepared_term Term object.
 * @param WP_REST_Request $request       Request object.
 * @return object
function wp_kama_rest_pre_insert_taxonomy_filter( $prepared_term, $request ){

	// filter...
	return $prepared_term;
Term object.
Request object.

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

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

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

wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php 859
return apply_filters( "rest_pre_insert_{$this->taxonomy}", $prepared_term, $request );

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

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