Changeset 50706
- Timestamp:
- 04/13/2021 05:59:45 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-custom-background.php
r49388 r50706 118 118 if ( isset( $_POST['reset-background'] ) ) { 119 119 check_admin_referer( 'custom-background-reset', '_wpnonce-custom-background-reset' ); 120 120 121 remove_theme_mod( 'background_image' ); 121 122 remove_theme_mod( 'background_image_thumb' ); 123 122 124 $this->updated = true; 123 125 return; … … 127 129 // @todo Uploaded files are not removed here. 128 130 check_admin_referer( 'custom-background-remove', '_wpnonce-custom-background-remove' ); 131 129 132 set_theme_mod( 'background_image', '' ); 130 133 set_theme_mod( 'background_image_thumb', '' ); 134 131 135 $this->updated = true; 132 136 wp_safe_redirect( $_POST['_wp_http_referer'] ); … … 205 209 if ( isset( $_POST['background-color'] ) ) { 206 210 check_admin_referer( 'custom-background' ); 211 207 212 $color = preg_replace( '/[^0-9a-fA-F]/', '', $_POST['background-color'] ); 208 if ( strlen( $color ) == 6 || strlen( $color ) == 3 ) { 213 214 if ( strlen( $color ) === 6 || strlen( $color ) === 3 ) { 209 215 set_theme_mod( 'background_color', $color ); 210 216 } else { … … 309 315 310 316 <?php $default_image = get_theme_support( 'custom-background', 'default-image' ); ?> 311 <?php if ( $default_image && get_background_image() != $default_image ) : ?>317 <?php if ( $default_image && get_background_image() !== $default_image ) : ?> 312 318 <tr> 313 319 <th scope="row"><?php _e( 'Restore Original Image' ); ?></th> … … 485 491 486 492 check_admin_referer( 'custom-background-upload', '_wpnonce-custom-background-upload' ); 493 487 494 $overrides = array( 'test_form' => false ); 488 495
Note: See TracChangeset
for help on using the changeset viewer.