diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index 2c46fd8d58..dad4070384 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -236,6 +236,20 @@ class WP_REST_Server { $this->send_header( 'Access-Control-Expose-Headers', 'X-WP-Total, X-WP-TotalPages' ); $this->send_header( 'Access-Control-Allow-Headers', 'Authorization' ); + /** + * Send nocache headers on authenticated requests. + * + * @since 4.4.0 + * + * @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() ); + if ( $send_no_cache_headers ) { + foreach ( wp_get_nocache_headers() as $header => $header_value ) { + $this->send_header( $header, $header_value ); + } + } + /** * Filter whether the REST API is enabled. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 4c92ecd2fc..28e25124cb 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-RC1-35772'; +$wp_version = '4.4-RC1-35773'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.