Make WordPress Core

Ticket #34747: a842df4.diff

File a842df4.diff, 4.0 KB (added by ryankienstra, 9 years ago)
  • src/wp-admin/customize.php

    diff --git src/wp-admin/customize.php src/wp-admin/customize.php
    index 7f667d3..4c69c6f 100644
    do_action( 'customize_controls_print_scripts' ); 
    128128                </div>
    129129
    130130                <div id="widgets-right" class="wp-clearfix"><!-- For Widget Customizer, many widgets try to look for instances under div#widgets-right, so we have to add that ID to a container div in the Customizer for compat -->
    131                 <div class="wp-full-overlay-sidebar-content" tabindex="-1">
    132                         <div id="customize-info" class="accordion-section customize-info">
    133                                 <div class="accordion-section-title">
    134                                         <span class="preview-notice"><?php
    135                                                 echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name' ) . '</strong>' );
    136                                         ?></span>
    137                                         <button class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button>
    138                                 </div>
    139                                 <div class="customize-panel-description"><?php
    140                                         _e( 'The Customizer allows you to preview changes to your site before publishing them. You can also navigate to different pages on your site to preview them.' );
    141                                 ?></div>
    142                         </div>
     131                        <div class="wp-full-overlay-sidebar-content" tabindex="-1"><?php
     132
     133                                $original_customizer_title = get_bloginfo( 'name' );
     134
     135                                /**
     136                                 * Filter title in root Customizer panel.
     137                                 *
     138                                 * @since 4.6
     139                                 *
     140                                 * @param string $customizer_title Appears at top of root Customizer panel.
     141                                 */
     142                                $filtered_customizer_title = apply_filters( 'customize_root_panel_title', $original_customizer_title );
     143
     144                                if ( ! empty( $filtered_customizer_title ) ):
     145                                ?>
     146                                        <div id="customize-info" class="accordion-section customize-info">
     147                                                <div class="accordion-section-title">
     148                                                        <span class="preview-notice"><?php
     149                                                                // If the title has been filtered, add a class so that JavaScript won't change it on updating the 'Site Title' control.
     150                                                                $is_filtered_class = ( $filtered_customizer_title === $original_customizer_title ) ? '' : ' title-is-filtered';
     151                                                                echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title' . esc_attr( $is_filtered_class ) . '">' . $filtered_customizer_title . '</strong>' );
     152                                                        ?></span><?php
     153
     154                                                        /**
     155                                                         * Filter description in primary Customizer panel.
     156                                                         *
     157                                                         * @since 4.6
     158                                                         *
     159                                                         * @param string $customizer_description Appears at top of root Customizer panel, under Customizer title.
     160                                                         */
     161                                                        $customizer_description = apply_filters( 'customize_root_panel_description', __( 'The Customizer allows you to preview changes to your site before publishing them. You can also navigate to different pages on your site to preview them.' ) );
     162                                                        if ( ! empty( $customizer_description ) ):
     163                                                                ?>
     164                                                                <button class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false">
     165                                                                        <span class="screen-reader-text"><?php _e( 'Help' ); ?></span>
     166                                                                </button>
     167                                                        <?php endif; ?>
     168                                                </div>
     169                                                <div class="customize-panel-description">
     170                                                        <?php echo $customizer_description; ?>
     171                                                </div>
     172                                        </div>
     173                                <?php endif; ?>
    143174
    144175                        <div id="customize-theme-controls">
    145176                                <ul><?php // Panels and sections are managed here via JavaScript ?></ul>
  • src/wp-admin/js/customize-controls.js

    diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
    index e1021a3..7b0830f 100644
     
    36533653                                .addClass( 'preview-' + newDevice );
    36543654                } );
    36553655
    3656                 // Bind site title display to the corresponding field.
    3657                 if ( title.length ) {
     3656                // Bind site title display to the corresponding field, if the filter 'customize_root_panel_title' hasn't changed it.
     3657                if ( title.length && ( ! title.hasClass( 'title-is-filtered' ) ) ) {
    36583658                        api( 'blogname', function( setting ) {
    36593659                                var updateTitle = function() {
    36603660                                        title.text( $.trim( setting() ) || api.l10n.untitledBlogName );