WordPress.org

Make WordPress Core

Changeset 23572


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

Twenty Twelve: enable live preview for Header Text Color in Theme Customizer. Change also removes an !important declaration (yay) in Custom Header CSS rules.

Props SriniG, fixes #23600.

Location:
trunk/wp-content/themes/twentytwelve
Files:
3 edited

Legend:

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

    r23568 r23572  
    438438 */
    439439function twentytwelve_customize_register( $wp_customize ) {
    440     $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
    441     $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
     440    $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
     441    $wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
     442    $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
    442443}
    443444add_action( 'customize_register', 'twentytwelve_customize_register' );
  • trunk/wp-content/themes/twentytwelve/inc/custom-header.php

    r22573 r23572  
    7878        else :
    7979    ?>
    80         .site-title a,
    81         .site-description {
    82             color: #<?php echo $text_color; ?> !important;
     80        .site-header h1 a,
     81        .site-header h2 {
     82            color: #<?php echo $text_color; ?>;
    8383        }
    8484    <?php endif; ?>
  • trunk/wp-content/themes/twentytwelve/js/theme-customizer.js

    r23568 r23572  
    1616        value.bind( function( to ) {
    1717            $( '.site-description' ).text( to );
     18        } );
     19    } );
     20    // Header text color
     21    wp.customize( 'header_textcolor', function( value ) {
     22        value.bind( function( to ) {
     23            $( '.site-title a, .site-description' ).css( 'color', to );
    1824        } );
    1925    } );
Note: See TracChangeset for help on using the changeset viewer.