Make WordPress Core


Ignore:
Timestamp:
07/03/2015 08:46:48 PM (9 years ago)
Author:
westonruter
Message:

Customizer: Fix saving menus with empty names or names that are already used.

Adds validation for initially-supplied nav menu name, blocking empty names from being supplied. If later an empty name is supplied and the nav menu is saved, the name "(unnamed)" will be supplied instead and supplied back to the client. If a name is supplied for the menu which is currently used by another menu, then the name conflict is resolved by adding a numerical counter similar to how post_name conflicts are resolved. Includes unit tests.

Fixes #32760.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r33036 r33071  
    282282            'l10n'                 => array(
    283283                'untitled'          => _x( '(no label)', 'missing menu item navigation label' ),
     284                'unnamed'           => _x( '(unnamed)', 'Missing menu name.' ),
    284285                'custom_label'      => __( 'Custom Link' ),
    285286                /* translators: %s: Current menu location */
Note: See TracChangeset for help on using the changeset viewer.