From dfba0ae9aee8f3defb6f7baea41a41e1a2967505 Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Thu, 18 Jul 2019 02:32:26 +0200
Subject: [PATCH] Simplify & modernize walk_category_dropdown_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 2f67df1ec5..7f98ef4a85 100644
|
a
|
b
|
function walk_category_tree( ...$args ) { |
| 1079 | 1079 | * |
| 1080 | 1080 | * @uses Walker_CategoryDropdown to create HTML dropdown content. |
| 1081 | 1081 | * @since 2.1.0 |
| 1082 | | * @see Walker_CategoryDropdown::walk() for parameters and return description. |
| | 1082 | * @see Walker::walk() for parameters and return description. |
| | 1083 | * |
| | 1084 | * @param mixed ...$args Elements array, maximum hierarchical depth and optional additional arguments. |
| 1083 | 1085 | * @return string |
| 1084 | 1086 | */ |
| 1085 | | function walk_category_dropdown_tree() { |
| 1086 | | $args = func_get_args(); |
| 1087 | | // the user's options are the third parameter |
| | 1087 | function walk_category_dropdown_tree( ...$args ) { |
| | 1088 | // The user's options are the third parameter. |
| 1088 | 1089 | if ( empty( $args[2]['walker'] ) || ! ( $args[2]['walker'] instanceof Walker ) ) { |
| 1089 | 1090 | $walker = new Walker_CategoryDropdown; |
| 1090 | 1091 | } else { |
| 1091 | 1092 | $walker = $args[2]['walker']; |
| 1092 | 1093 | } |
| 1093 | | return call_user_func_array( array( $walker, 'walk' ), $args ); |
| | 1094 | return $walker->walk( ...$args ); |
| 1094 | 1095 | } |
| 1095 | 1096 | |
| 1096 | 1097 | // |