diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index 3b158ea07f..06bb9f9f80 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -19,8 +19,6 @@ define( 'REST_API_VERSION', '2.0' ); * * @since 4.4.0 * - * @global WP_REST_Server $wp_rest_server ResponseHandler instance (usually WP_REST_Server). - * * @param string $namespace The first URL segment after core prefix. Should be unique to your package/plugin. * @param string $route The base URL for route you are adding. * @param array $args Optional. Either an array of options for the endpoint, or an array of arrays for @@ -30,9 +28,6 @@ define( 'REST_API_VERSION', '2.0' ); * @return bool True on success, false on error. */ function register_rest_route( $namespace, $route, $args = array(), $override = false ) { - /** @var WP_REST_Server $wp_rest_server */ - global $wp_rest_server; - if ( empty( $namespace ) ) { /* * Non-namespaced routes are not allowed, with the exception of the main @@ -74,7 +69,7 @@ function register_rest_route( $namespace, $route, $args = array(), $override = f } $full_route = '/' . trim( $namespace, '/' ) . '/' . trim( $route, '/' ); - $wp_rest_server->register_route( $namespace, $full_route, $args, $override ); + rest_get_server()->register_route( $namespace, $full_route, $args, $override ); return true; } @@ -245,7 +240,6 @@ function create_initial_rest_routes() { * @since 4.4.0 * * @global WP $wp Current WordPress environment instance. - * @global WP_REST_Server $wp_rest_server ResponseHandler instance (usually WP_REST_Server). */ function rest_api_loaded() { if ( empty( $GLOBALS['wp']->query_vars['rest_route'] ) ) { @@ -387,8 +381,6 @@ function rest_url( $path = '', $scheme = 'json' ) { * * @since 4.4.0 * - * @global WP_REST_Server $wp_rest_server ResponseHandler instance (usually WP_REST_Server). - * * @param WP_REST_Request|string $request Request. * @return WP_REST_Response REST response. */ @@ -704,7 +696,6 @@ function rest_output_link_header() { * @since 4.4.0 * * @global mixed $wp_rest_auth_cookie - * @global WP_REST_Server $wp_rest_server REST server instance. * * @param WP_Error|mixed $result Error from another authentication handler, * null if we should handle it, or another value @@ -716,7 +707,7 @@ function rest_cookie_check_errors( $result ) { return $result; } - global $wp_rest_auth_cookie, $wp_rest_server; + global $wp_rest_auth_cookie; /* * Is cookie authentication being used? (If we get an auth @@ -750,7 +741,7 @@ function rest_cookie_check_errors( $result ) { } // Send a refreshed nonce in header. - $wp_rest_server->send_header( 'X-WP-Nonce', wp_create_nonce( 'wp_rest' ) ); + rest_get_server()->send_header( 'X-WP-Nonce', wp_create_nonce( 'wp_rest' ) ); return true; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 02ef80a332..2c96e12a3c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41237'; +$wp_version = '4.9-alpha-41238'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.