From a1d81cda6435981c565c93159316bfcd8d667da6 Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Thu, 18 Jul 2019 02:31:55 +0200
Subject: [PATCH] Simplify & modernize walk_category_tree()

Includes minor documentation fixes.
---
 src/wp-includes/category-template.php | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php
index 1b2da3c122..2f67df1ec5 100644
--- a/src/wp-includes/category-template.php
+++ b/src/wp-includes/category-template.php
@@ -1059,18 +1059,19 @@ function _wp_object_count_sort_cb( $a, $b ) {
  *
  * @uses Walker_Category to create HTML list content.
  * @since 2.1.0
- * @see Walker_Category::walk() for parameters and return description.
+ * @see Walker::walk() for parameters and return description.
+ *
+ * @param mixed ...$args Elements array, maximum hierarchical depth and optional additional arguments.
  * @return string
  */
-function walk_category_tree() {
-	$args = func_get_args();
-	// the user's options are the third parameter
+function walk_category_tree( ...$args ) {
+	// The user's options are the third parameter.
 	if ( empty( $args[2]['walker'] ) || ! ( $args[2]['walker'] instanceof Walker ) ) {
 		$walker = new Walker_Category;
 	} else {
 		$walker = $args[2]['walker'];
 	}
-	return call_user_func_array( array( $walker, 'walk' ), $args );
+	return $walker->walk( ...$args );
 }
 
 /**
-- 
2.21.0.windows.1

