WordPress.org

Make WordPress Core

Ticket #47678: 47678-walk_page_dropdown_tree.patch

File 47678-walk_page_dropdown_tree.patch, 1.0 KB (added by jrf, 12 months ago)

Simplify & modernize walk_page_dropdown_tree()

  • src/wp-includes/post-template.php

    From 8744bbd2c972a74766723bfa329c0a3abfb7bf27 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Thu, 11 Jul 2019 12:03:05 +0200
    Subject: [PATCH] Simplify & modernize walk_page_dropdown_tree()
    
    ---
     src/wp-includes/post-template.php | 5 ++---
     1 file changed, 2 insertions(+), 3 deletions(-)
    
    diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php
    index db2bd4875f..b91b775554 100644
    a b function walk_page_tree( $pages, $depth, $current_page, $r ) { 
    15471547 *
    15481548 * @return string
    15491549 */
    1550 function walk_page_dropdown_tree() {
    1551         $args = func_get_args();
     1550function walk_page_dropdown_tree( ...$args ) {
    15521551        if ( empty( $args[2]['walker'] ) ) { // the user's options are the third parameter
    15531552                $walker = new Walker_PageDropdown;
    15541553        } else {
    15551554                $walker = $args[2]['walker'];
    15561555        }
    15571556
    1558         return call_user_func_array( array( $walker, 'walk' ), $args );
     1557        return $walker->walk( ...$args );
    15591558}
    15601559
    15611560//