From 46728105d526c373f044b493b589bed444123d45 Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Thu, 11 Jul 2019 12:29:19 +0200
Subject: [PATCH] Simplify & modernize wp_register_widget_control()

---
 src/wp-includes/widgets.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/wp-includes/widgets.php b/src/wp-includes/widgets.php
index 8961d4ec3c..e3bb63b582 100644
--- a/src/wp-includes/widgets.php
+++ b/src/wp-includes/widgets.php
@@ -479,7 +479,7 @@ function wp_unregister_sidebar_widget( $id ) {
  * }
  * @param mixed      ...$params        Optional additional parameters to pass to the callback function when it's called.
  */
-function wp_register_widget_control( $id, $name, $control_callback, $options = array() ) {
+function wp_register_widget_control( $id, $name, $control_callback, $options = array(), ...$params ) {
 	global $wp_registered_widget_controls, $wp_registered_widget_updates, $wp_registered_widgets, $_wp_deprecated_widgets_callbacks;
 
 	$id      = strtolower( $id );
@@ -512,7 +512,7 @@ function wp_register_widget_control( $id, $name, $control_callback, $options = a
 		'name'     => $name,
 		'id'       => $id,
 		'callback' => $control_callback,
-		'params'   => array_slice( func_get_args(), 4 ),
+		'params'   => $params,
 	);
 	$widget = array_merge( $widget, $options );
 
-- 
2.21.0.windows.1

