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

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

Built from https://develop.svn.wordpress.org/trunk@41868


git-svn-id: http://core.svn.wordpress.org/trunk@41702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2017-10-15 22:23:47 +00:00
parent 46ff957961
commit 12f647679b
7 changed files with 24 additions and 24 deletions

View File

@ -2459,7 +2459,7 @@
this._setupAddition();
this._setupTitle();
// Add menu to Custom Menu widgets.
// Add menu to Navigation Menu widgets.
if ( menu ) {
name = displayNavMenuName( menu.name );
@ -2509,7 +2509,7 @@
if ( false === to ) {
control._handleDeletion();
} else {
// Update names in the Custom Menu widgets.
// Update names in the Navigation Menu widgets.
name = displayNavMenuName( to.name );
api.control.each( function( widgetControl ) {
if ( ! widgetControl.extended( api.controlConstructor.widget_form ) || 'nav_menu' !== widgetControl.params.widget_id_base ) {
@ -2651,7 +2651,7 @@
}
});
// Remove the menu from any Custom Menu widgets.
// Remove the menu from any Navigation Menu widgets.
api.control.each(function( widgetControl ) {
if ( ! widgetControl.extended( api.controlConstructor.widget_form ) || 'nav_menu' !== widgetControl.params.widget_id_base ) {
return;
@ -3063,7 +3063,7 @@
// Add new control for the new menu.
api.section.add( newSection );
// Update the values for nav menus in Custom Menu controls.
// Update the values for nav menus in Navigation Menu controls.
api.control.each( function( setting ) {
if ( ! setting.extended( api.controlConstructor.widget_form ) || 'nav_menu' !== setting.params.widget_id_base ) {
return;

View File

@ -514,12 +514,12 @@ wp_nav_menu_setup();
wp_initial_nav_menu_meta_boxes();
if ( ! current_theme_supports( 'menus' ) && ! $num_locations )
$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>';
$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>';
if ( ! $locations_screen ) : // Main tab
$overview = '<p>' . __( 'This screen is used for managing your custom navigation menus.' ) . '</p>';
$overview = '<p>' . __( 'This screen is used for managing your navigation menus.' ) . '</p>';
/* translators: 1: Widgets admin screen URL, 2 and 3: The name of the default themes */
$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>';
$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>';
$overview .= '<p>' . __( 'From this screen you can:' ) . '</p>';
$overview .= '<ul><li>' . __( 'Create, edit, and delete menus' ) . '</li>';
$overview .= '<li>' . __( 'Add, organize, and modify individual menu items' ) . '</li></ul>';
@ -541,7 +541,7 @@ if ( ! $locations_screen ) : // Main tab
'content' => $menu_management
) );
$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>';
$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>';
$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>';
$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>';
$editing_menus .= '<li>' . __( 'To add a custom link, <strong>expand the Custom Links section, enter a URL and link text, and click Add to Menu</strong>' ) .'</li>';

View File

@ -556,7 +556,7 @@ final class WP_Customize_Nav_Menus {
$description = '<p>' . __( 'This panel is used for managing navigation menus for content you have already published on your site. You can create menus and add items for existing content such as pages, posts, categories, tags, formats, or custom links.' ) . '</p>';
if ( current_theme_supports( 'widgets' ) ) {
/* translators: URL to the widgets panel of the customizer */
$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>';
$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>';
} else {
$description .= '<p>' . __( 'Menus can be displayed in locations defined by your theme.' ) . '</p>';
}
@ -580,7 +580,7 @@ final class WP_Customize_Nav_Menus {
if ( current_theme_supports( 'widgets' ) ) {
/* translators: URL to the widgets panel of the customizer */
$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>';
$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>';
}
$this->manager->add_section( 'menu_locations', array(
@ -761,7 +761,7 @@ final class WP_Customize_Nav_Menus {
* @since 4.3.0
* @since 4.7.0 Each array item now includes a `$type_label` in addition to `$title`, `$type`, and `$object`.
*
* @param array $item_types Custom menu item types.
* @param array $item_types Navigation menu item types.
*/
$item_types = apply_filters( 'customize_nav_menu_available_item_types', $item_types );

View File

@ -1365,7 +1365,7 @@ final class WP_Customize_Widgets {
/*
* Make sure that other setting changes have previewed since this widget
* may depend on them (e.g. Menus being present for Custom Menu widget).
* may depend on them (e.g. Menus being present for Navigation Menu widget).
*/
if ( ! did_action( 'customize_preview_init' ) ) {
foreach ( $this->manager->settings() as $setting ) {

View File

@ -883,7 +883,7 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
/*
* Only trigger renders on (nested) partials that have been not been
* handled yet. An example where this would apply is a nav menu
* embedded inside of a custom menu widget. When the widget's title
* embedded inside of a navigation menu widget. When the widget's title
* is updated, the entire widget will re-render and then the event
* will be triggered for the nested nav menu to do any initialization.
*/

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-beta2-41867';
$wp_version = '4.9-beta2-41868';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -8,7 +8,7 @@
*/
/**
* Core class used to implement the Custom Menu widget.
* Core class used to implement the Navigation Menu widget.
*
* @since 3.0.0
*
@ -17,26 +17,26 @@
class WP_Nav_Menu_Widget extends WP_Widget {
/**
* Sets up a new Custom Menu widget instance.
* Sets up a new Navigation Menu widget instance.
*
* @since 3.0.0
*/
public function __construct() {
$widget_ops = array(
'description' => __( 'Add a custom menu to your sidebar.' ),
'description' => __( 'Add a navigation menu to your sidebar.' ),
'customize_selective_refresh' => true,
);
parent::__construct( 'nav_menu', __('Custom Menu'), $widget_ops );
parent::__construct( 'nav_menu', __('Navigation Menu'), $widget_ops );
}
/**
* Outputs the content for the current Custom Menu widget instance.
* Outputs the content for the current Navigation Menu widget instance.
*
* @since 3.0.0
*
* @param array $args Display arguments including 'before_title', 'after_title',
* 'before_widget', and 'after_widget'.
* @param array $instance Settings for the current Custom Menu widget instance.
* @param array $instance Settings for the current Navigation Menu widget instance.
*/
public function widget( $args, $instance ) {
// Get menu
@ -63,13 +63,13 @@ class WP_Nav_Menu_Widget extends WP_Widget {
);
/**
* Filters the arguments for the Custom Menu widget.
* Filters the arguments for the Navigation Menu widget.
*
* @since 4.2.0
* @since 4.4.0 Added the `$instance` parameter.
*
* @param array $nav_menu_args {
* An array of arguments passed to wp_nav_menu() to retrieve a custom menu.
* An array of arguments passed to wp_nav_menu() to retrieve a navigation menu.
*
* @type callable|bool $fallback_cb Callback to fire if the menu doesn't exist. Default empty.
* @type mixed $menu Menu ID, slug, or name.
@ -84,7 +84,7 @@ class WP_Nav_Menu_Widget extends WP_Widget {
}
/**
* Handles updating settings for the current Custom Menu widget instance.
* Handles updating settings for the current Navigation Menu widget instance.
*
* @since 3.0.0
*
@ -105,7 +105,7 @@ class WP_Nav_Menu_Widget extends WP_Widget {
}
/**
* Outputs the settings form for the Custom Menu widget.
* Outputs the settings form for the Navigation Menu widget.
*
* @since 3.0.0
*