WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/02/2021 07:01:18 PM (8 months ago)
Author:
SergeyBiryukov
Message:

General: Remove admin and login exceptions for https in get_home_url().

Previously, get_home_url() would automatically switch to https if the current request is already https, but would only do so on the front end.

This addresses the inconsistent behavior of returning different values in the admin and on the frontend.

Follow-up to [12598], [21937], [24844].

Props herregroen, mukesh27.
Fixes #52421.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r50132 r50156  
    32543254 * @since 3.0.0
    32553255 *
    3256  * @global string $pagenow
    3257  *
    32583256 * @param int         $blog_id Optional. Site ID. Default null (current site).
    32593257 * @param string      $path    Optional. Path relative to the home URL. Default empty.
     
    32633261 */
    32643262function get_home_url( $blog_id = null, $path = '', $scheme = null ) {
    3265     global $pagenow;
    3266 
    32673263    $orig_scheme = $scheme;
    32683264
     
    32763272
    32773273    if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ), true ) ) {
    3278         if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow ) {
     3274        if ( is_ssl() ) {
    32793275            $scheme = 'https';
    32803276        } else {
Note: See TracChangeset for help on using the changeset viewer.