rest_send_nocache_headers

rest_send_nocache_headers

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.1

apply_filters('rest_send_nocache_headers') is found 1 times:

  • /wp-includes/rest-api/class-wp-rest-server.php line 485
    		 * @since 6.3.2 Moved the block to catch the filter added on rest_cookie_check_errors() from wp-includes/rest-api.php.
    		 *
    		 * @param bool $rest_send_nocache_headers Whether to send no-cache headers.
    		 */
    		$send_no_cache_headers = apply_filters( 'rest_send_nocache_headers', is_user_logged_in() );
    
    		/*
    		 * Send no-cache headers if $send_no_cache_headers is true,
    		 * OR if the HTTP_X_HTTP_METHOD_OVERRIDE is used but resulted a 4xx response code.
    		 */
    		if ( $send_no_cache_headers || ( true === $method_overridden && str_starts_with( $code, '4' ) ) ) {