rest_route_for_taxonomy_items
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_route_for_taxonomy_items
wp-includes/rest-api.php 3250
return apply_filters( 'rest_route_for_taxonomy_items', $route, $taxonomy );