diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index c831fed7ec..fd6dc3e5f9 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -337,6 +337,14 @@ function get_rest_url( $blog_id = null, $path = '/', $scheme = 'rest' ) { } } + if ( is_admin() && force_ssl_admin() ) { + // In this situation the home URL may be http:, and `is_ssl()` may be + // false, but the admin is served over https: (one way or another), so + // REST API usage will be blocked by browsers unless it is also served + // over HTTPS. + $url = set_url_scheme( $url, 'https' ); + } + /** * Filters the REST URL. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 1016cfa141..304578f60c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-beta2-40842'; +$wp_version = '4.8-beta2-40843'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.