rest_route_for_term хук-фильтрWP 5.5.0

Filters the REST API route for a term.

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

add_filter( 'rest_route_for_term', 'wp_kama_rest_route_for_term_filter', 10, 2 );

/**
 * Function for `rest_route_for_term` filter-hook.
 * 
 * @param string  $route The route path.
 * @param WP_Term $term  The term object.
 *
 * @return string
 */
function wp_kama_rest_route_for_term_filter( $route, $term ){

	// filter...
	return $route;
}
$route(строка)
The route path.
$term(WP_Term)
The term object.

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

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

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

rest_get_route_for_term()
rest_route_for_term
wp-includes/rest-api.php 3214
return apply_filters( 'rest_route_for_term', $route, $term );

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

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