| | 589 | function twentyeleven_customize_include($wp_customize) { |
| | 590 | if ( !isset( $wp_customize ) ) |
| | 591 | return; |
| | 592 | |
| | 593 | $sett = $wp_customize->get_setting('blogname'); |
| | 594 | $sett->transport='postMessage'; |
| | 595 | |
| | 596 | $sett = $wp_customize->get_setting('blogdescription'); |
| | 597 | $sett->transport='postMessage'; |
| | 598 | |
| | 599 | $sett = $wp_customize->get_setting('header_textcolor'); |
| | 600 | $sett->transport='postMessage'; |
| | 601 | |
| | 602 | if ( $wp_customize->is_preview() && ! is_admin() ) |
| | 603 | add_action( 'wp_footer', 'twentyeleven_customize_preview', 21); |
| | 604 | } |
| | 605 | add_action( 'customize_register', 'twentyeleven_customize_include' ); |
| | 606 | |
| | 607 | function twentyeleven_customize_preview() { |
| | 608 | ?> |
| | 609 | <script type="text/javascript"> |
| | 610 | wp.customize('blogname',function( value ) { |
| | 611 | value.bind(function(to) { |
| | 612 | jQuery('#site-title a').html(to); |
| | 613 | }); |
| | 614 | }); |
| | 615 | wp.customize('blogdescription',function( value ) { |
| | 616 | value.bind(function(to) { |
| | 617 | jQuery('#site-description').html(to); |
| | 618 | }); |
| | 619 | }); |
| | 620 | wp.customize( 'header_textcolor', function( value ) { |
| | 621 | value.bind( function( to ) { |
| | 622 | jQuery('#site-title a, #site-description').css('color', to ? '#' + to : '' ); |
| | 623 | }); |
| | 624 | }); |
| | 625 | </script> |
| | 626 | <?php |
| | 627 | } |