WordPress.org

Make WordPress Core

Changeset 41868


Ignore:
Timestamp:
10/15/2017 10:22:59 PM (2 years ago)
Author:
westonruter
Message:

Widgets: Rename "Custom Menu" widget to "Navigation Menu".

Props gk.loveweb, ChrisHardie, ajayghaghretiya1, melchoyce.
Fixes #40442.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-nav-menus.js

    r41860 r41868  
    24602460            this._setupTitle();
    24612461
    2462             // Add menu to Custom Menu widgets.
     2462            // Add menu to Navigation Menu widgets.
    24632463            if ( menu ) {
    24642464                name = displayNavMenuName( menu.name );
     
    25102510                    control._handleDeletion();
    25112511                } else {
    2512                     // Update names in the Custom Menu widgets.
     2512                    // Update names in the Navigation Menu widgets.
    25132513                    name = displayNavMenuName( to.name );
    25142514                    api.control.each( function( widgetControl ) {
     
    26522652            });
    26532653
    2654             // Remove the menu from any Custom Menu widgets.
     2654            // Remove the menu from any Navigation Menu widgets.
    26552655            api.control.each(function( widgetControl ) {
    26562656                if ( ! widgetControl.extended( api.controlConstructor.widget_form ) || 'nav_menu' !== widgetControl.params.widget_id_base ) {
     
    30643064                api.section.add( newSection );
    30653065
    3066                 // Update the values for nav menus in Custom Menu controls.
     3066                // Update the values for nav menus in Navigation Menu controls.
    30673067                api.control.each( function( setting ) {
    30683068                    if ( ! setting.extended( api.controlConstructor.widget_form ) || 'nav_menu' !== setting.params.widget_id_base ) {
  • trunk/src/wp-admin/nav-menus.php

    r40313 r41868  
    515515
    516516if ( ! current_theme_supports( 'menus' ) && ! $num_locations )
    517     $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a &#8220;Custom Menu&#8221; widget on the <a href="%s">Widgets</a> screen.' ), admin_url( 'widgets.php' ) ) . '</p></div>';
     517    $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%s">Widgets</a> screen.' ), admin_url( 'widgets.php' ) ) . '</p></div>';
    518518
    519519if ( ! $locations_screen ) : // Main tab
    520     $overview  = '<p>' . __( 'This screen is used for managing your custom navigation menus.' ) . '</p>';
     520    $overview  = '<p>' . __( 'This screen is used for managing your navigation menus.' ) . '</p>';
    521521    /* translators: 1: Widgets admin screen URL, 2 and 3: The name of the default themes */
    522     $overview .= '<p>' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a &#8220;Custom Menu&#8221; widget on the <a href="%1$s">Widgets</a> screen. If your theme does not support the custom menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Sixteen', 'Twenty Seventeen' ) . '</p>';
     522    $overview .= '<p>' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%1$s">Widgets</a> screen. If your theme does not support the navigation menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Sixteen', 'Twenty Seventeen' ) . '</p>';
    523523    $overview .= '<p>' . __( 'From this screen you can:' ) . '</p>';
    524524    $overview .= '<ul><li>' . __( 'Create, edit, and delete menus' ) . '</li>';
     
    542542    ) );
    543543
    544     $editing_menus  = '<p>' . __( 'Each custom menu may contain a mix of links to pages, categories, custom URLs or other content types. Menu links are added by selecting items from the expanding boxes in the left-hand column below.' ) . '</p>';
     544    $editing_menus  = '<p>' . __( 'Each navigation menu may contain a mix of links to pages, categories, custom URLs or other content types. Menu links are added by selecting items from the expanding boxes in the left-hand column below.' ) . '</p>';
    545545    $editing_menus .= '<p>' . __( '<strong>Clicking the arrow to the right of any menu item</strong> in the editor will reveal a standard group of settings. Additional settings such as link target, CSS classes, link relationships, and link descriptions can be enabled and disabled via the Screen Options tab.' ) . '</p>';
    546546    $editing_menus .= '<ul><li>' . __( 'Add one or several items at once by <strong>selecting the checkbox next to each item and clicking Add to Menu</strong>' ) . '</li>';
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r41823 r41868  
    557557        if ( current_theme_supports( 'widgets' ) ) {
    558558            /* translators: URL to the widgets panel of the customizer */
    559             $description .= '<p>' . sprintf( __( 'Menus can be displayed in locations defined by your theme or in <a href="%s">widget areas</a> by adding a &#8220;Custom Menu&#8221; widget.' ), "javascript:wp.customize.panel( 'widgets' ).focus();" ) . '</p>';
     559            $description .= '<p>' . sprintf( __( 'Menus can be displayed in locations defined by your theme or in <a href="%s">widget areas</a> by adding a &#8220;Navigation Menu&#8221; widget.' ), "javascript:wp.customize.panel( 'widgets' ).focus();" ) . '</p>';
    560560        } else {
    561561            $description .= '<p>' . __( 'Menus can be displayed in locations defined by your theme.' ) . '</p>';
     
    581581        if ( current_theme_supports( 'widgets' ) ) {
    582582            /* translators: URL to the widgets panel of the customizer */
    583             $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>';
     583            $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;Navigation Menu widget&#8221; to display a menu in a sidebar or footer.' ), "javascript:wp.customize.panel( 'widgets' ).focus();" ) . '</p>';
    584584        }
    585585
     
    762762         * @since 4.7.0  Each array item now includes a `$type_label` in addition to `$title`, `$type`, and `$object`.
    763763         *
    764          * @param array $item_types Custom menu item types.
     764         * @param array $item_types Navigation menu item types.
    765765         */
    766766        $item_types = apply_filters( 'customize_nav_menu_available_item_types', $item_types );
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r41640 r41868  
    13661366        /*
    13671367         * Make sure that other setting changes have previewed since this widget
    1368          * may depend on them (e.g. Menus being present for Custom Menu widget).
     1368         * may depend on them (e.g. Menus being present for Navigation Menu widget).
    13691369         */
    13701370        if ( ! did_action( 'customize_preview_init' ) ) {
  • trunk/src/wp-includes/js/customize-selective-refresh.js

    r41726 r41868  
    884884             * Only trigger renders on (nested) partials that have been not been
    885885             * handled yet. An example where this would apply is a nav menu
    886              * embedded inside of a custom menu widget. When the widget's title
     886             * embedded inside of a navigation menu widget. When the widget's title
    887887             * is updated, the entire widget will re-render and then the event
    888888             * will be triggered for the nested nav menu to do any initialization.
  • trunk/src/wp-includes/widgets/class-wp-nav-menu-widget.php

    r41867 r41868  
    99
    1010/**
    11  * Core class used to implement the Custom Menu widget.
     11 * Core class used to implement the Navigation Menu widget.
    1212 *
    1313 * @since 3.0.0
     
    1818
    1919    /**
    20      * Sets up a new Custom Menu widget instance.
     20     * Sets up a new Navigation Menu widget instance.
    2121     *
    2222     * @since 3.0.0
     
    2424    public function __construct() {
    2525        $widget_ops = array(
    26             'description' => __( 'Add a custom menu to your sidebar.' ),
     26            'description' => __( 'Add a navigation menu to your sidebar.' ),
    2727            'customize_selective_refresh' => true,
    2828        );
    29         parent::__construct( 'nav_menu', __('Custom Menu'), $widget_ops );
     29        parent::__construct( 'nav_menu', __('Navigation Menu'), $widget_ops );
    3030    }
    3131
    3232    /**
    33      * Outputs the content for the current Custom Menu widget instance.
     33     * Outputs the content for the current Navigation Menu widget instance.
    3434     *
    3535     * @since 3.0.0
     
    3737     * @param array $args     Display arguments including 'before_title', 'after_title',
    3838     *                        'before_widget', and 'after_widget'.
    39      * @param array $instance Settings for the current Custom Menu widget instance.
     39     * @param array $instance Settings for the current Navigation Menu widget instance.
    4040     */
    4141    public function widget( $args, $instance ) {
     
    6464
    6565        /**
    66          * Filters the arguments for the Custom Menu widget.
     66         * Filters the arguments for the Navigation Menu widget.
    6767         *
    6868         * @since 4.2.0
     
    7070         *
    7171         * @param array    $nav_menu_args {
    72          *     An array of arguments passed to wp_nav_menu() to retrieve a custom menu.
     72         *     An array of arguments passed to wp_nav_menu() to retrieve a navigation menu.
    7373         *
    7474         *     @type callable|bool $fallback_cb Callback to fire if the menu doesn't exist. Default empty.
     
    8585
    8686    /**
    87      * Handles updating settings for the current Custom Menu widget instance.
     87     * Handles updating settings for the current Navigation Menu widget instance.
    8888     *
    8989     * @since 3.0.0
     
    106106
    107107    /**
    108      * Outputs the settings form for the Custom Menu widget.
     108     * Outputs the settings form for the Navigation Menu widget.
    109109     *
    110110     * @since 3.0.0
Note: See TracChangeset for help on using the changeset viewer.