WordPress.org

Make WordPress Core

Ticket #47678: 47678-Walker-paged_walk.patch

File 47678-Walker-paged_walk.patch, 1.3 KB (added by jrf, 13 months ago)

Use spread operator in Walker::paged_walk()

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

    From 6c85d3218326b04ce588e66fc116b30d94f063fd Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Thu, 11 Jul 2019 11:50:22 +0200
    Subject: [PATCH] Use spread operator in Walker::paged_walk()
    
    ---
     src/wp-includes/class-wp-walker.php | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/src/wp-includes/class-wp-walker.php b/src/wp-includes/class-wp-walker.php
    index 1d60e28632..4d35b093f5 100644
    a b class Walker { 
    276276         *
    277277         * @param array $elements
    278278         * @param int   $max_depth The maximum hierarchical depth.
    279          * @param int   $page_num The specific page number, beginning with 1.
     279         * @param int   $page_num  The specific page number, beginning with 1.
    280280         * @param int   $per_page
     281         * @param mixed ...$args   Optional additional arguments.
    281282         * @return string XHTML of the specified page of elements
    282283         */
    283         public function paged_walk( $elements, $max_depth, $page_num, $per_page ) {
     284        public function paged_walk( $elements, $max_depth, $page_num, $per_page, ...$args ) {
    284285                if ( empty( $elements ) || $max_depth < -1 ) {
    285286                        return '';
    286287                }
    287288
    288                 $args   = array_slice( func_get_args(), 4 );
    289289                $output = '';
    290290
    291291                $parent_field = $this->db_fields['parent'];