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

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

Filters REST authentication errors.

This is used to pass a WP_Error from an authentication method back to the API.

Authentication methods should check first if they're being used, as multiple authentication methods can be enabled on a site (cookies, HTTP basic auth, OAuth). If the authentication method hooked in is not actually being attempted, null should be returned to indicate another authentication method should check instead. Similarly, callbacks should ensure the value is null before checking for errors.

A WP_Error instance can be returned if an error occurs, and this should match the format used by API methods internally (that is, the status data should be used). A callback can return true to indicate that the authentication method was used, and it succeeded.

Использование

add_filter( 'rest_authentication_errors', 'filter_function_name_6563' );
function filter_function_name_6563( $null ){
	// filter...

	return $null;
}
$null(WP_Error/null/true/false)
WP_Error if authentication error, null if authentication method wasn't used, true if authentication succeeded.

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

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

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

WP_REST_Server::check_authentication()
rest_authentication_errors
wp-includes/rest-api/class-wp-rest-server.php 135
return apply_filters( 'rest_authentication_errors', null );

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

wp-includes/default-filters.php 278
add_filter( 'rest_authentication_errors', 'rest_cookie_check_errors', 100 );