WordPress.org

Make WordPress Core

Changeset 20221


Ignore:
Timestamp:
03/20/2012 08:34:49 PM (6 years ago)
Author:
nacin
Message:

In new add_theme_support() logic, fix logic inversion, define HEADER_IMAGE in a simpler way, and force args to be an array. see #20249.

File:
1 edited

Legend:

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

    r20218 r20221  
    12841284
    12851285        case 'custom-header' :
     1286            if ( ! is_array( $args ) )
     1287                $args = array( 0 => array() );
     1288
    12861289            $defaults = array(
    12871290                'default-image' => '',
     
    13301333            if ( defined( 'HEADER_IMAGE_HEIGHT' ) )
    13311334                $args[0]['height'] = (int) HEADER_IMAGE_HEIGHT;
    1332             elseif ( ! isset( $args[0]['height'] ) )
     1335            elseif ( isset( $args[0]['height'] ) )
    13331336                define( 'HEADER_IMAGE_HEIGHT', (int) $args[0]['height'] );
    13341337
     
    13401343            if ( defined( 'HEADER_IMAGE' ) )
    13411344                $args[0]['default-image'] = HEADER_IMAGE;
     1345            elseif ( isset( $args[0]['default-image'] ) )
     1346                define( 'HEADER_IMAGE', $args[0]['default-image'] );
    13421347
    13431348            if ( $jit && ! empty( $args[0]['default-image'] ) )
    13441349                $args[0]['random-default'] = false;
    1345 
    1346             if ( ! defined( 'HEADER_IMAGE' ) && ( isset( $args[0]['default-image'] ) || isset( $args[0]['random-default'] ) ) )
    1347                 define( 'HEADER_IMAGE', $args[0]['default-image'] );
    13481350
    13491351            // If headers are supported, and we still don't have a defined width or height,
     
    13591361
    13601362        case 'custom-background' :
     1363            if ( ! is_array( $args ) )
     1364                $args = array( 0 => array() );
     1365
    13611366            $defaults = array(
    13621367                'default-image' => '',
Note: See TracChangeset for help on using the changeset viewer.