WordPress.org

Make WordPress Core

Ticket #18232: 18232.patch

File 18232.patch, 870 bytes (added by SergeyBiryukov, 4 years ago)
  • wp-includes/nav-menu-template.php

     
    169169 
    170170        // If no menu was found or if the menu has no items and no location was requested, call the fallback_cb if it exists 
    171171        if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) ) 
    172                 && $args->fallback_cb && is_callable( $args->fallback_cb ) ) 
     172                && $args->fallback_cb && is_callable( $args->fallback_cb ) ) { 
     173                        if ( 'wp_page_menu' == $args->fallback_cb )  
     174                                $args->walker = ''; 
     175 
    173176                        return call_user_func( $args->fallback_cb, (array) $args ); 
     177        } 
    174178 
    175179        // If no fallback function was specified and the menu doesn't exists, bail. 
    176180        if ( !$menu || is_wp_error($menu) )