Fix hiding of header image. Fix radio selection when falling back to randomized default headers. Props lancewillett, kawauso. see #17240
git-svn-id: https://develop.svn.wordpress.org/trunk@17770 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f1747e6f35
commit
54822700b8
@ -193,7 +193,7 @@ class Custom_Image_Header {
|
||||
|
||||
if ( isset( $_POST['removeheader'] ) ) {
|
||||
check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
|
||||
set_theme_mod( 'header_image', '' );
|
||||
set_theme_mod( 'header_image', 'remove-header' );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -546,7 +546,7 @@ class Custom_Image_Header {
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;
|
||||
if ( get_header_image() && !is_random_header_image() ) : ?>
|
||||
if ( get_header_image() ) : ?>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e( 'Remove Image' ); ?></th>
|
||||
<td>
|
||||
@ -556,7 +556,7 @@ class Custom_Image_Header {
|
||||
</tr>
|
||||
<?php endif;
|
||||
|
||||
if ( defined( 'HEADER_IMAGE' ) && !is_random_header_image() ) : ?>
|
||||
if ( defined( 'HEADER_IMAGE' ) && '' != HEADER_IMAGE ) : ?>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e( 'Reset Image' ); ?></th>
|
||||
<td>
|
||||
|
@ -1429,6 +1429,9 @@ function get_header_image() {
|
||||
$default = defined( 'HEADER_IMAGE' ) ? HEADER_IMAGE : '';
|
||||
$url = get_theme_mod( 'header_image', $default );
|
||||
|
||||
if ( 'remove-header' == $url )
|
||||
return false;
|
||||
|
||||
if ( is_random_header_image() )
|
||||
$url = get_random_header_image();
|
||||
|
||||
@ -1489,6 +1492,8 @@ function is_random_header_image( $type = 'any' ) {
|
||||
} else {
|
||||
if ( "random-$type-image" == $header_image_mod )
|
||||
return true;
|
||||
elseif ( 'default' == $type && empty( $header_image_mod ) && '' != get_random_header_image() )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user