WordPress.org

Make WordPress Core

Changeset 16846


Ignore:
Timestamp:
12/09/2010 05:59:35 PM (9 years ago)
Author:
nacin
Message:

Make get_header_image() ssl-aware. fixes #14835.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r16721 r16846  
    14161416 */
    14171417function get_header_image() {
    1418     $default = defined('HEADER_IMAGE') ? HEADER_IMAGE : '';
    1419 
    1420     return get_theme_mod('header_image', $default);
     1418    $default = defined( 'HEADER_IMAGE' ) ? HEADER_IMAGE : '';
     1419
     1420    $url = get_theme_mod( 'header_image', $default );
     1421
     1422    if ( is_ssl() )
     1423        $url = str_replace( 'http://', 'https://', $url );
     1424    else
     1425        $url = str_replace( 'https://', 'http://', $url );
     1426
     1427    return $url;
    14211428}
    14221429
Note: See TracChangeset for help on using the changeset viewer.