rest_endpoints хук-фильтр . WP 4.4.0
Filters the array of available endpoints.
Использование
add_filter( 'rest_endpoints', 'filter_function_name_9951' ); function filter_function_name_9951( $endpoints ){ // filter... return $endpoints; }
- $endpoints(массив)
- The available endpoints. An array of matching regex patterns, each mapped to an array of callbacks for the endpoint. These take the format '/path/regex' => array( $callback, $bitmask ) or `'/path/regex' => array( array( $callback, $bitmask ).
Список изменений
С версии 4.4.0 | Введена. |
Где вызывается хук
rest_endpoints
wp-includes/rest-api/class-wp-rest-server.php 869
$endpoints = apply_filters( 'rest_endpoints', $endpoints );