Make WordPress Core

Changeset 21013


Ignore:
Timestamp:
06/06/2012 09:24:22 PM (13 years ago)
Author:
ryan
Message:

Don't resurrect a removed default image when changing colors in the Customizer. Props koopersmith, nacin. fixes #20448

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-customize-manager.php

    r21010 r21013  
    313313            'values'  => array(),
    314314            'channel' => esc_js( $_POST['customize_messenger_channel'] ),
     315            'backgroundImageHasDefault' => current_theme_supports( 'custom-background', 'default-image' ),
    315316        );
    316317
  • trunk/wp-includes/js/customize-preview.dev.js

    r20988 r21013  
    110110
    111111            update = function() {
    112                 var css = '';
     112                var css = '',
     113                    hasDefault = api.settings.backgroundImageHasDefault;
    113114
    114115                // The body will support custom backgrounds if either
     
    116117                //
    117118                // See get_body_class() in /wp-includes/post-template.php
    118                 body.toggleClass( 'custom-background', !! ( color() || image() ) );
     119                body.toggleClass( 'custom-background', !! ( color() || image() || hasDefault ) );
    119120
    120121                if ( color() )
     
    126127                    css += 'background-repeat: ' + repeat() + ';';
    127128                    css += 'background-position: top ' + attachment() + ';';
     129                } else if ( hasDefault ) {
     130                    css += 'background-image: none;';
    128131                }
    129132
Note: See TracChangeset for help on using the changeset viewer.