Filter hook 'rest_endpoints_description'

in WP Core File wp-includes/rest-api/class-wp-rest-server.php at line 1584

View Source

rest_endpoints_description

Filter Hook
Description
Filters the publicly-visible data for a single REST API route.

Hook Information

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

Hook Parameters

Type Name Description
array $data Publicly-visible data for the route.

Usage Examples

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

function my_custom_filter($data) {
    // Your custom filtering logic here
    return $data;
}

Source Code Context

wp-includes/rest-api/class-wp-rest-server.php:1584 - How this hook is used in WordPress core
<?php
1579  			 *
1580  			 * @since 4.4.0
1581  			 *
1582  			 * @param array $data Publicly-visible data for the route.
1583  			 */
1584  			$available[ $route ] = apply_filters( 'rest_endpoints_description', $data );
1585  		}
1586  
1587  		/**
1588  		 * Filters the publicly-visible data for REST API routes.
1589  		 *

PHP Documentation

<?php
/**
			 * Filters the publicly-visible data for a single REST API route.
			 *
			 * @since 4.4.0
			 *
			 * @param array $data Publicly-visible data for the route.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/rest-api/class-wp-rest-server.php
Related Hooks

Related hooks will be displayed here in future updates.