rest_route_data filter-hook . WP 4.4.0
Filters the publicly-visible data for routes.
This data is exposed on indexes and can be used by clients or developers to investigate the site and find out how to use it. It acts as a form of self-documentation.
Usage
add_filter( 'rest_route_data', 'filter_function_name_5605', 10, 2 ); function filter_function_name_5605( $available, $routes ){ // filter... return $available; }
- $available(array[])
- Route data to expose in indexes, keyed by route.
- $routes(array)
- Internal route data as an associative array.
Changelog
Since 4.4.0 | Introduced. |
Where the hook is called
rest_route_data
wp-includes/rest-api/class-wp-rest-server.php 1351
return apply_filters( 'rest_route_data', $available, $routes );