Make WordPress Core

Changeset 28836


Ignore:
Timestamp:
06/26/2014 12:56:07 AM (10 years ago)
Author:
wonderboymusic
Message:

return false in has_nav_menu() if the $location does not exist in the $_wp_registered_nav_menus global.

Props SergeyBiryukov.
Fixes #27735.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/nav-menu.php

    r28825 r28836  
    143143 */
    144144function has_nav_menu( $location ) {
     145    global $_wp_registered_nav_menus;
     146
     147    if ( ! isset( $_wp_registered_nav_menus[ $location ] ) ) {
     148        return false;
     149    }
     150
    145151    $locations = get_nav_menu_locations();
    146152    return ( ! empty( $locations[ $location ] ) );
Note: See TracChangeset for help on using the changeset viewer.