Make WordPress Core

Ticket #42170: 42170.diff

File 42170.diff, 2.1 KB (added by felipeelia, 8 years ago)
  • src/wp-includes/class-wp-customize-nav-menus.php

     
    403403                        $locations_description = sprintf( _n( 'Your theme can display menus in %s location.', 'Your theme can display menus in %s locations.', $num_locations ), number_format_i18n( $num_locations ) );
    404404                }
    405405
     406                if ( 1 === $num_locations ) {
     407                        $locations_title = __( 'Menu Location' );
     408                } else {
     409                        $locations_title = __( 'Menu Locations' );
     410                }
     411
    406412                // Pass data to JS.
    407413                $settings = array(
    408414                        'allMenus'             => wp_get_nav_menus(),
     
    414420                                'page_label'             => get_post_type_object( 'page' )->labels->singular_name,
    415421                                /* translators: %s:      menu location */
    416422                                'menuLocation'           => _x( '(Currently set to: %s)', 'menu' ),
    417                                 'locationsTitle'         => _n( 'Menu Location', 'Menu Locations', $num_locations ),
     423                                'locationsTitle'         => $locations_title,
    418424                                'locationsDescription'   => $locations_description,
    419425                                'menuNameLabel'          => __( 'Menu Name' ),
    420426                                'newMenuNameDescription' => __( 'If your theme has multiple menus, giving them clear names will help you manage them.' ),
     
    583589                        $description .= '<p>' . sprintf( __( 'If your theme has widget areas, you can also add menus there. Visit the <a href="%s">Widgets panel</a> and add a &#8220;Custom Menu widget&#8221; to display a menu in a sidebar or footer.' ), "javascript:wp.customize.panel( 'widgets' ).focus();" ) . '</p>';
    584590                }
    585591
     592                if ( 1 === $num_locations ) {
     593                        $title = _x( 'View Location', 'menu locations' );
     594                } else {
     595                        $title = _x( 'View All Locations', 'menu locations' );
     596                }
     597
    586598                $this->manager->add_section( 'menu_locations', array(
    587                         'title'       => _nx( 'View Location', 'View All Locations', $num_locations, 'menu locations' ),
     599                        'title'       => $title,
    588600                        'panel'       => 'nav_menus',
    589601                        'priority'    => 30,
    590602                        'description' => $description