rest_send_nocache_headers filter-hookWP 4.4.0

Filters whether to send nocache headers on a REST API request.

Usage

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.

Changelog

Since 4.4.0 Introduced.

Where the hook is called

WP_REST_Server::serve_request()
rest_send_nocache_headers
wp-includes/rest-api/class-wp-rest-server.php 368
$send_no_cache_headers = apply_filters( 'rest_send_nocache_headers', is_user_logged_in() );

Where the hook is used in WordPress

Usage not found.