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
|
b
|
function wp_unregister_sidebar_widget( $id ) { |
| 479 | 479 | * } |
| 480 | 480 | * @param mixed ...$params Optional additional parameters to pass to the callback function when it's called. |
| 481 | 481 | */ |
| 482 | | function wp_register_widget_control( $id, $name, $control_callback, $options = array() ) { |
| | 482 | function wp_register_widget_control( $id, $name, $control_callback, $options = array(), ...$params ) { |
| 483 | 483 | global $wp_registered_widget_controls, $wp_registered_widget_updates, $wp_registered_widgets, $_wp_deprecated_widgets_callbacks; |
| 484 | 484 | |
| 485 | 485 | $id = strtolower( $id ); |
| … |
… |
function wp_register_widget_control( $id, $name, $control_callback, $options = a |
| 512 | 512 | 'name' => $name, |
| 513 | 513 | 'id' => $id, |
| 514 | 514 | 'callback' => $control_callback, |
| 515 | | 'params' => array_slice( func_get_args(), 4 ), |
| | 515 | 'params' => $params, |
| 516 | 516 | ); |
| 517 | 517 | $widget = array_merge( $widget, $options ); |
| 518 | 518 | |