WordPress.org

Make WordPress Core

Changeset 41832


Ignore:
Timestamp:
10/11/2017 07:37:10 PM (3 years ago)
Author:
westonruter
Message:

Customize: Vary description for nav menu locations control based on whether it is shown during menu creation.

Also fix issue with initial visibility of notice when there are no menus.

Amends [41823].
Props bpayton, melchoyce, westonruter.
See #42116.
Fixes #42113.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/customize-controls.css

    r41817 r41832  
    678678
    679679.customize-section-description-container,
    680 .control-section-nav_menu .customize-section-description-container {
     680.control-section-nav_menu .customize-section-description-container,
     681.control-section-new_menu .customize-section-description-container {
    681682    margin-bottom: 15px;
     683}
     684
     685.control-section-nav_menu .customize-control,
     686.control-section-new_menu .customize-control {
     687    /* Override default `margin-bottom` for `.customize-control` */
     688    margin-bottom: 0;
    682689}
    683690
  • trunk/src/wp-admin/css/customize-nav-menus.css

    r41823 r41832  
    11#customize-theme-controls #accordion-section-menu_locations {
    22    position: relative;
    3     margin-top: 15px;
     3    margin-top: 30px;
    44}
    55
     
    5151    float: right;
    5252    min-width: 85px;
    53 }
    54 
    55 #customize-new-menu-submit-description {
    56     margin: 0;
    5753}
    5854
     
    213209    margin-top: 24px;
    214210    border-top: 1px solid #ddd;
     211}
     212
     213.wp-customizer .control-section-nav_menu .menu-location-settings,
     214.customize-control-nav_menu_auto_add {
    215215    padding-top: 12px;
    216216}
     
    218218.customize-control-nav_menu_auto_add label {
    219219    vertical-align: top;
     220}
     221
     222.menu-location-settings .new-menu-locations-widget-note {
     223    display: block;
    220224}
    221225
  • trunk/src/wp-admin/js/customize-nav-menus.js

    r41823 r41832  
    813813            });
    814814
    815             // Wait until after construction to patch the UI
    816             _.defer( function () {
    817 
    818                 panel.contentContainer.find( '#accordion-section-menu_locations' ).prepend(
     815            // Inject additional heading into the menu locations section's head container.
     816            api.section( 'menu_locations', function( section ) {
     817                section.headContainer.prepend(
    819818                    wp.template( 'nav-menu-locations-header' )( api.Menus.data )
    820                 );
    821 
    822                 panel.contentContainer.find( '#accordion-section-add_menu .accordion-section-title' ).replaceWith(
    823                     wp.template( 'nav-menu-create-menu-section-title' )
    824819                );
    825820            } );
     
    11671162                navMenuSettingPattern = /^nav_menu\[/;
    11681163
     1164            section.headContainer.find( '.accordion-section-title' ).replaceWith(
     1165                wp.template( 'nav-menu-create-menu-section-title' )
     1166            );
     1167
    11691168            /*
    11701169             * We have to manually handle section expanded because we do not
     
    12901289                    section: section.id,
    12911290                    priority: 1,
    1292                     menu_id: ''
     1291                    menu_id: '',
     1292                    isCreating: true
    12931293                } );
    12941294                api.control.add( menuLocationsControlId, menuLocationsControl );
  • trunk/src/wp-includes/customize/class-wp-customize-nav-menu-locations-control.php

    r41768 r41832  
    3636     */
    3737    public function content_template() {
    38         if ( current_theme_supports( 'menus' ) ):
     38        if ( current_theme_supports( 'menus' ) ) :
    3939            ?>
    4040            <# var elementId; #>
    4141            <ul class="menu-location-settings">
    4242                <li class="customize-control assigned-menu-locations-title">
    43                     <span class="customize-control-title"><?php _e( 'Menu Locations' ); ?></span>
    44                     <p><?php _e( 'Here\'s where this menu appears. If you\'d like to change that, pick another location.' ); ?></p>
     43                    <span class="customize-control-title">{{ wp.customize.Menus.data.l10n.locationsTitle }}</span>
     44                    <# if ( data.isCreating ) { #>
     45                        <p>
     46                            <?php echo _x( 'Where do you want this menu to appear?', 'menu locations' ); ?>
     47                            <em class="new-menu-locations-widget-note">
     48                                <?php
     49                                printf(
     50                                    /* translators: 1: Codex URL, 2: additional link attributes, 3: accessibility text */
     51                                    _x( '(If you plan to use a menu <a href="%1$s" %2$s>widget%3$s</a>, skip this step.)', 'menu locations' ),
     52                                    __( 'https://codex.wordpress.org/WordPress_Widgets' ),
     53                                    ' class="external-link" target="_blank"',
     54                                    sprintf( '<span class="screen-reader-text"> %s</span>',
     55                                        /* translators: accessibility text */
     56                                        __( '(opens in a new window)' )
     57                                    )
     58                                );
     59                                ?>
     60                            </em>
     61                        </p>
     62                    <# } else { #>
     63                        <p><?php echo _x( 'Here&#8217;s where this menu appears. If you&#8217;d like to change that, pick another location.', 'menu locations' ); ?></p>
     64                    <# } #>
    4565                </li>
    4666
Note: See TracChangeset for help on using the changeset viewer.