Make WordPress Core

Ticket #41081: 41081.diff

File 41081.diff, 552 bytes (added by mdifelice, 7 years ago)

Patch for hiding empty menus in Nav Menu Widget (differential from the root repository)

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

     
    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                ?>