diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index 9e7d37f2c7..72ee1b696e 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -325,6 +325,8 @@ function get_rest_url( $blog_id = null, $path = '/', $scheme = 'rest' ) { $path = '/'; } + $path = '/' . ltrim( $path, '/' ); + if ( is_multisite() && get_blog_option( $blog_id, 'permalink_structure' ) || get_option( 'permalink_structure' ) ) { global $wp_rewrite; @@ -334,7 +336,7 @@ function get_rest_url( $blog_id = null, $path = '/', $scheme = 'rest' ) { $url = get_home_url( $blog_id, rest_get_url_prefix(), $scheme ); } - $url .= '/' . ltrim( $path, '/' ); + $url .= $path; } else { $url = trailingslashit( get_home_url( $blog_id, '', $scheme ) ); // nginx only allows HTTP/1.0 methods when redirecting from / to /index.php @@ -343,8 +345,6 @@ function get_rest_url( $blog_id = null, $path = '/', $scheme = 'rest' ) { $url .= 'index.php'; } - $path = '/' . ltrim( $path, '/' ); - $url = add_query_arg( 'rest_route', $path, $url ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index f1b34f48a4..6dac456fd7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43765'; +$wp_version = '5.0-alpha-43766'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.