WordPress.org

Make WordPress Core

Ticket #17240: 17240-fix-hide-header.diff

File 17240-fix-hide-header.diff, 1.3 KB (added by lancewillett, 7 years ago)
  • wp-includes/theme.php

     
    14291429        $default = defined( 'HEADER_IMAGE' ) ? HEADER_IMAGE : '';
    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();
    14341437
  • wp-admin/custom-header.php

     
    193193
    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                }
    199199
     
    546546</td>
    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>
    552552<td>
     
    556556</tr>
    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>
    562562<td>