WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
фильтр не описан

rest_pre_dispatch хук-фильтр . WP 4.4.0

Filters the pre-calculated result of a REST dispatch request.

Allow hijacking the request before dispatching by returning a non-empty. The returned value will be used to serve the request instead.


add_filter( 'rest_pre_dispatch', 'filter_function_name_9581', 10, 3 );
function filter_function_name_9581( $result, $this, $request ){
	// filter...

	return $result;
Response to replace the requested version with. Can be anything a normal endpoint can return, or null to not hijack the request.
Server instance.
Request used to generate the response.

Список изменений

С версии 4.4.0 Введена.

Где вызывается хук

wp-includes/rest-api/class-wp-rest-server.php 873
$result = apply_filters( 'rest_pre_dispatch', null, $this, $request );

Где используется хук в ядре WP

wp-includes/rest-api.php 186
add_filter( 'rest_pre_dispatch', 'rest_handle_options_request', 10, 3 );