diff --git src/wp-includes/rest-api.php src/wp-includes/rest-api.php
index c831fed7ec..7546f4d54f 100644
|
|
function get_rest_url( $blog_id = null, $path = '/', $scheme = 'rest' ) { |
330 | 330 | $url = add_query_arg( 'rest_route', $path, $url ); |
331 | 331 | } |
332 | 332 | |
333 | | if ( is_ssl() ) { |
334 | | // If the current host is the same as the REST URL host, force the REST URL scheme to HTTPS. |
335 | | if ( $_SERVER['SERVER_NAME'] === parse_url( get_home_url( $blog_id ), PHP_URL_HOST ) ) { |
336 | | $url = set_url_scheme( $url, 'https' ); |
337 | | } |
| 333 | if ( is_ssl() || ( is_admin() && force_ssl_admin() ) ) { |
| 334 | $url = set_url_scheme( $url, 'https' ); |
338 | 335 | } |
339 | 336 | |
340 | 337 | /** |