rest_route_for_taxonomy_items filter-hookWP 5.9.0

Filters the REST API route for a taxonomy.

Usage

add_filter( 'rest_route_for_taxonomy_items', 'wp_kama_rest_route_for_taxonomy_items_filter', 10, 2 );

/**
 * Function for `rest_route_for_taxonomy_items` filter-hook.
 * 
 * @param string      $route    The route path.
 * @param WP_Taxonomy $taxonomy The taxonomy object.
 *
 * @return string
 */
function wp_kama_rest_route_for_taxonomy_items_filter( $route, $taxonomy ){

	// filter...
	return $route;
}
$route(string)
The route path.
$taxonomy(WP_Taxonomy)
The taxonomy object.

Changelog

Since 5.9.0 Introduced.

Where the hook is called

rest_get_route_for_taxonomy_items()
rest_route_for_taxonomy_items
wp-includes/rest-api.php 3247
return apply_filters( 'rest_route_for_taxonomy_items', $route, $taxonomy );

Where the hook is used in WordPress

Usage not found.