diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index fdc3034755..4304881b16 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -466,22 +466,6 @@ class WP_REST_Server { $code = $result->get_status(); $this->set_status( $code ); - /** - * Filters whether the REST API request has already been served. - * - * Allow sending the request manually - by returning true, the API result - * will not be sent to the client. - * - * @since 4.4.0 - * - * @param bool $served Whether the request has already been served. - * Default false. - * @param WP_HTTP_Response $result Result to send to the client. Usually a `WP_REST_Response`. - * @param WP_REST_Request $request Request used to generate the response. - * @param WP_REST_Server $server Server instance. - */ - $served = apply_filters( 'rest_pre_serve_request', false, $result, $request, $this ); - /** * Filters whether to send nocache headers on a REST API request. * @@ -504,6 +488,22 @@ class WP_REST_Server { } } + /** + * Filters whether the REST API request has already been served. + * + * Allow sending the request manually - by returning true, the API result + * will not be sent to the client. + * + * @since 4.4.0 + * + * @param bool $served Whether the request has already been served. + * Default false. + * @param WP_HTTP_Response $result Result to send to the client. Usually a `WP_REST_Response`. + * @param WP_REST_Request $request Request used to generate the response. + * @param WP_REST_Server $server Server instance. + */ + $served = apply_filters( 'rest_pre_serve_request', false, $result, $request, $this ); + if ( ! $served ) { if ( 'HEAD' === $request->get_method() ) { return null; diff --git a/wp-includes/version.php b/wp-includes/version.php index 3d8f7bdd23..1a585993a7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57011'; +$wp_version = '6.5-alpha-57012'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.