WordPress.org

Make WordPress Core

Ticket #47678: 47678-walk_nav_menu_tree.patch

File 47678-walk_nav_menu_tree.patch, 914 bytes (added by jrf, 12 months ago)

Simplify walk_nav_menu_tree()

  • src/wp-includes/nav-menu-template.php

    From 16823d6e2687d0649397eca5407f1333301dc71c Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Thu, 18 Jul 2019 08:13:06 +0200
    Subject: [PATCH] Simplify walk_nav_menu_tree()
    
    ---
     src/wp-includes/nav-menu-template.php | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/src/wp-includes/nav-menu-template.php b/src/wp-includes/nav-menu-template.php
    index 6de77f24d5..56bdf4a25c 100644
    a b function _wp_menu_item_classes_by_context( &$menu_items ) { 
    579579 */
    580580function walk_nav_menu_tree( $items, $depth, $r ) {
    581581        $walker = ( empty( $r->walker ) ) ? new Walker_Nav_Menu : $r->walker;
    582         $args   = array( $items, $depth, $r );
    583582
    584         return call_user_func_array( array( $walker, 'walk' ), $args );
     583        return $walker->walk( $items, $depth, $r );
    585584}
    586585
    587586/**