rest_send_nocache_headers

rest_send_nocache_headers

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

See hook in core

Displaying hooks found in version: wordpress-6.4.3

apply_filters('rest_send_nocache_headers') is found 1 times:

  • /wp-includes/rest-api/class-wp-rest-server.php line 477
    		 * @since 6.3.2 Moved the block to catch the filter added on rest_cookie_check_errors() from 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 the $send_no_cache_headers is true
    		// OR if the HTTP_X_HTTP_METHOD_OVERRIDE is used but resulted a 4x response code.
    		if ( $send_no_cache_headers || ( true === $method_overridden && strpos( $code, '4' ) === 0 ) ) {
    			foreach ( wp_get_nocache_headers() as $header => $header_value ) {
    				if ( empty( $header_value ) ) {