Make WordPress Core

Changeset 28197


Ignore:
Timestamp:
04/24/2014 08:44:32 PM (11 years ago)
Author:
markjaquith
Message:

Force users to choose a nav menu in the custom nav menu widget, for a better customizer UX

Before, they had to make a dummy change to get it to render. Now they
are made to choose a nav menu from the dropdown, which feels more
natural.

fixes #27878 for trunk. props westonruter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-widgets.php

    r28195 r28197  
    13491349            <label for="<?php echo $this->get_field_id('nav_menu'); ?>"><?php _e('Select Menu:'); ?></label>
    13501350            <select id="<?php echo $this->get_field_id('nav_menu'); ?>" name="<?php echo $this->get_field_name('nav_menu'); ?>">
     1351                <option value="0"><?php _e( '-- Select --' ) ?></option>
    13511352        <?php
    13521353            foreach ( $menus as $menu ) {
    13531354                echo '<option value="' . $menu->term_id . '"'
    13541355                    . selected( $nav_menu, $menu->term_id, false )
    1355                     . '>'. $menu->name . '</option>';
     1356                    . '>'. esc_html( $menu->name ) . '</option>';
    13561357            }
    13571358        ?>
Note: See TracChangeset for help on using the changeset viewer.