rest_send_nocache_headers
Filters whether to send no-cache headers on a REST API request.
Использование
add_filter( 'rest_send_nocache_headers', 'wp_kama_rest_send_nocache_headers_filter' ); /** * Function for `rest_send_nocache_headers` filter-hook. * * @param bool $rest_send_nocache_headers Whether to send no-cache headers. * * @return bool */ function wp_kama_rest_send_nocache_headers_filter( $rest_send_nocache_headers ){ // filter... return $rest_send_nocache_headers; }
- $rest_send_nocache_headers(true|false)
- Whether to send no-cache headers.
Список изменений
С версии 4.4.0 | Введена. |
С версии 6.3.2 | Moved the block to catch the filter added on rest_cookie_check_errors() from wp-includes/rest-api.php. |
Где вызывается хук
rest_send_nocache_headers
wp-includes/rest-api/class-wp-rest-server.php 485
$send_no_cache_headers = apply_filters( 'rest_send_nocache_headers', is_user_logged_in() );
Где используется хук в WordPress
wp-includes/rest-api.php 1100
add_filter( 'rest_send_nocache_headers', '__return_true', 20 );