WordPress.org

Make WordPress Core

Changeset 28198


Ignore:
Timestamp:
04/24/2014 09:09:40 PM (7 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.

Merges [28197] to the 3.9 branch.

fixes #27878. props westonruter

File:
1 edited

Legend:

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

    r28196 r28198  
    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.