From fa9e32e461c9afeae28e939a9edc9e4811a1f029 Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Thu, 11 Jul 2019 12:29:01 +0200
Subject: [PATCH] Simplify & modernize wp_register_sidebar_widget()
---
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 28c79d1764..8961d4ec3c 100644
a
|
b
|
function is_registered_sidebar( $sidebar_id ) { |
339 | 339 | * } |
340 | 340 | * @param mixed ...$params Optional additional parameters to pass to the callback function when it's called. |
341 | 341 | */ |
342 | | function wp_register_sidebar_widget( $id, $name, $output_callback, $options = array() ) { |
| 342 | function wp_register_sidebar_widget( $id, $name, $output_callback, $options = array(), ...$params ) { |
343 | 343 | global $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_updates, $_wp_deprecated_widgets_callbacks; |
344 | 344 | |
345 | 345 | $id = strtolower( $id ); |
… |
… |
function wp_register_sidebar_widget( $id, $name, $output_callback, $options = ar |
362 | 362 | 'name' => $name, |
363 | 363 | 'id' => $id, |
364 | 364 | 'callback' => $output_callback, |
365 | | 'params' => array_slice( func_get_args(), 4 ), |
| 365 | 'params' => $params, |
366 | 366 | ); |
367 | 367 | $widget = array_merge( $widget, $options ); |
368 | 368 | |