WordPress.org

Make WordPress Core

Changeset 17770


Ignore:
Timestamp:
04/29/2011 07:45:30 PM (7 years ago)
Author:
ryan
Message:

Fix hiding of header image. Fix radio selection when falling back to randomized default headers. Props lancewillett, kawauso. see #17240

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-header.php

    r17758 r17770  
    194194        if ( isset( $_POST['removeheader'] ) ) {
    195195            check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
    196             set_theme_mod( 'header_image', '' );
     196            set_theme_mod( 'header_image', 'remove-header' );
    197197            return;
    198198        }
     
    547547</tr>
    548548    <?php endif;
    549     if ( get_header_image() && !is_random_header_image() ) : ?>
     549    if ( get_header_image() ) : ?>
    550550<tr valign="top">
    551551<th scope="row"><?php _e( 'Remove Image' ); ?></th>
     
    557557    <?php endif;
    558558
    559     if ( defined( 'HEADER_IMAGE' ) && !is_random_header_image() ) : ?>
     559    if ( defined( 'HEADER_IMAGE' ) && '' != HEADER_IMAGE ) : ?>
    560560<tr valign="top">
    561561<th scope="row"><?php _e( 'Reset Image' ); ?></th>
  • trunk/wp-includes/theme.php

    r17757 r17770  
    14301430    $url = get_theme_mod( 'header_image', $default );
    14311431
     1432    if ( 'remove-header' == $url )
     1433        return false;
     1434
    14321435    if ( is_random_header_image() )
    14331436        $url = get_random_header_image();
     
    14891492    } else {
    14901493        if ( "random-$type-image" == $header_image_mod )
     1494            return true;
     1495        elseif ( 'default' == $type && empty( $header_image_mod ) && '' != get_random_header_image()  )
    14911496            return true;
    14921497    }
Note: See TracChangeset for help on using the changeset viewer.