WordPress.org

Make WordPress Core

Ticket #47678: 47678-Walker-walk.patch

File 47678-Walker-walk.patch, 1.0 KB (added by jrf, 9 months ago)

Use spread operator in Walker::walk()

  • src/wp-includes/class-wp-walker.php

    From fdb58876bbaec77c21d3979226b3c00d87f8e314 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Thu, 11 Jul 2019 11:47:05 +0200
    Subject: [PATCH] Use spread operator in Walker::walk()
    
    ---
     src/wp-includes/class-wp-walker.php | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/wp-includes/class-wp-walker.php b/src/wp-includes/class-wp-walker.php
    index 6799d42f28..1d60e28632 100644
    a b class Walker { 
    184184         *
    185185         * @param array $elements  An array of elements.
    186186         * @param int   $max_depth The maximum hierarchical depth.
     187         * @param mixed ...$args   Optional additional arguments.
    187188         * @return string The hierarchical item output.
    188189         */
    189         public function walk( $elements, $max_depth ) {
    190                 $args   = array_slice( func_get_args(), 2 );
     190        public function walk( $elements, $max_depth, ...$args ) {
    191191                $output = '';
    192192
    193193                //invalid parameter or nothing to walk