WordPress.org

Make WordPress Core

Ticket #13916: patch.txt

File patch.txt, 1.0 KB (added by DreadLox, 4 years ago)

Patch to correct the bug

Line 
1Index: wp-includes/nav-menu-template.php
2===================================================================
3--- wp-includes/nav-menu-template.php   (révision 15264)
4+++ wp-includes/nav-menu-template.php   (copie de travail)
5@@ -151,7 +151,7 @@
6        if ( ! $menu && !$args->theme_location ) {
7                $menus = wp_get_nav_menus();
8                foreach ( $menus as $menu_maybe ) {
9-                       if ( $menu_items = wp_get_nav_menu_items($menu_maybe->term_id) ) {
10+                       if ( $menu_items = wp_get_nav_menu_items($menu_maybe->term_id, $args) ) {
11                                $menu = $menu_maybe;
12                                break;
13                        }
14@@ -160,7 +160,7 @@
15 
16        // If the menu exists, get its items.
17        if ( $menu && ! is_wp_error($menu) && !isset($menu_items) )
18-               $menu_items = wp_get_nav_menu_items( $menu->term_id );
19+               $menu_items = wp_get_nav_menu_items( $menu->term_id, $args );
20 
21        // If no menu was found or if the menu has no items and no location was requested, call the fallback_cb if it exists
22        if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) )