Make WordPress Core

Ticket #41081: 41081.2.diff

File 41081.2.diff, 1.1 KB (added by welcher, 7 years ago)

Updating messaging to reflect the changes in this patch.

  • src/wp-includes/widgets/class-wp-nav-menu-widget.php

    diff --git src/wp-includes/widgets/class-wp-nav-menu-widget.php src/wp-includes/widgets/class-wp-nav-menu-widget.php
    index d7ad82b..33eaeb5 100644
    class WP_Nav_Menu_Widget extends WP_Widget { 
    118118                $nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';
    119119
    120120                // Get menus
    121                 $menus = wp_get_nav_menus();
     121                $menus = wp_get_nav_menus( array(
     122                        'hide_empty' => true,
     123                ) );
    122124
    123125                // If no menus exists, direct the user to go and create some.
    124126                ?>
    class WP_Nav_Menu_Widget extends WP_Widget { 
    130132                                $url = admin_url( 'nav-menus.php' );
    131133                        }
    132134                        ?>
    133                         <?php echo sprintf( __( 'No menus have been created yet. <a href="%s">Create some</a>.' ), esc_attr( $url ) ); ?>
     135                        <?php echo sprintf( __( 'No menus have been created or they are empty. <a href="%s">Mange menus</a>.' ), esc_attr( $url ) ); ?>
    134136                </p>
    135137                <div class="nav-menu-widget-form-controls" <?php if ( empty( $menus ) ) { echo ' style="display:none" '; } ?>>
    136138                        <p>