Filter hook 'rest_route_for_taxonomy_items'

in WP Core File wp-includes/rest-api.php at line 3298

View Source

rest_route_for_taxonomy_items

Filter Hook
Description
Filters the REST API route for a taxonomy.

Hook Information

File Location wp-includes/rest-api.php View on GitHub
Hook Type Filter
Line Number 3298

Hook Parameters

Type Name Description
string $route The route path.
WP_Taxonomy $taxonomy The taxonomy object.

Usage Examples

Basic Usage
<?php
// Hook into rest_route_for_taxonomy_items
add_filter('rest_route_for_taxonomy_items', 'my_custom_filter', 10, 2);

function my_custom_filter($route, $taxonomy) {
    // Your custom filtering logic here
    return $route;
}

Source Code Context

wp-includes/rest-api.php:3298 - How this hook is used in WordPress core
<?php
3293  	 * @since 5.9.0
3294  	 *
3295  	 * @param string      $route    The route path.
3296  	 * @param WP_Taxonomy $taxonomy The taxonomy object.
3297  	 */
3298  	return apply_filters( 'rest_route_for_taxonomy_items', $route, $taxonomy );
3299  }
3300  
3301  /**
3302   * Gets the REST route for the currently queried object.
3303   *

PHP Documentation

<?php
/**
	 * Filters the REST API route for a taxonomy.
	 *
	 * @since 5.9.0
	 *
	 * @param string      $route    The route path.
	 * @param WP_Taxonomy $taxonomy The taxonomy object.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/rest-api.php
Related Hooks

Related hooks will be displayed here in future updates.