Make WordPress Core


Ignore:
Timestamp:
03/01/2013 05:14:59 PM (11 years ago)
Author:
lancewillett
Message:

Twenty Twelve: better handling for cases where a background color is set to white or an empty value (like first run with no theme_mods set) and a background image is enabled, which resulted previously in a broken layout. Fixes #23586, props obenland.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentytwelve/functions.php

    r23427 r23568  
    384384function twentytwelve_body_class( $classes ) {
    385385    $background_color = get_background_color();
     386    $background_image = get_background_image();
    386387
    387388    if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) )
     
    396397    }
    397398
    398     if ( empty( $background_color ) )
    399         $classes[] = 'custom-background-empty';
    400     elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )
    401         $classes[] = 'custom-background-white';
     399    if ( empty( $background_image ) ) {
     400        if ( empty( $background_color ) )
     401            $classes[] = 'custom-background-empty';
     402        elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )
     403            $classes[] = 'custom-background-white';
     404    }
    402405
    403406    // Enable custom font class only if the font CSS is queued to load.
     
    446449 */
    447450function twentytwelve_customize_preview_js() {
    448     wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20120827', true );
     451    wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130301', true );
    449452}
    450453add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );
Note: See TracChangeset for help on using the changeset viewer.