WordPress.org

Make WordPress Core

Ticket #23508: 23508.2.diff

File 23508.2.diff, 988 bytes (added by SergeyBiryukov, 14 months ago)
  • wp-admin/nav-menus.php

     
    264264                // Get existing menu locations assignments 
    265265                $locations = get_registered_nav_menus(); 
    266266                $menu_locations = get_nav_menu_locations(); 
    267                 if ( empty( $menu_locations ) || ! is_array( $menu_locations ) ) 
    268                         $menu_locations = array(); 
    269267 
    270268                // Remove menu locations that have been unchecked 
    271269                foreach ( $locations as $location => $description ) { 
  • wp-includes/nav-menu.php

     
    127127 */ 
    128128 
    129129function get_nav_menu_locations() { 
    130         return get_theme_mod( 'nav_menu_locations' ); 
     130        $locations = get_theme_mod( 'nav_menu_locations' ); 
     131        return ( is_array( $locations ) ) ? $locations : array(); 
    131132} 
    132133 
    133134/**