Code Modernisation: Replace call_user_func_array() in wp-admin/includes/widgets.php and associated unit tests with a direct function call.

Props jrf.
See #47678.
Built from https://develop.svn.wordpress.org/trunk@46138


git-svn-id: http://core.svn.wordpress.org/trunk@45950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-09-15 11:41:55 +00:00
parent f166554882
commit 8ee3790851
2 changed files with 8 additions and 7 deletions

View File

@ -51,13 +51,13 @@ function wp_list_widgets() {
} }
} }
$args = wp_list_widget_controls_dynamic_sidebar( $control_args = array(
array( 0 => $args,
0 => $args, 1 => $widget['params'][0],
1 => $widget['params'][0],
)
); );
call_user_func_array( 'wp_widget_control', $args ); $sidebar_args = wp_list_widget_controls_dynamic_sidebar( $control_args );
wp_widget_control( ...$sidebar_args );
} }
} }
@ -144,6 +144,7 @@ function wp_list_widget_controls_dynamic_sidebar( $params ) {
$params[0]['after_widget'] = '</div>'; $params[0]['after_widget'] = '</div>';
$params[0]['before_title'] = '%BEG_OF_TITLE%'; // deprecated $params[0]['before_title'] = '%BEG_OF_TITLE%'; // deprecated
$params[0]['after_title'] = '%END_OF_TITLE%'; // deprecated $params[0]['after_title'] = '%END_OF_TITLE%'; // deprecated
if ( is_callable( $wp_registered_widgets[ $widget_id ]['callback'] ) ) { if ( is_callable( $wp_registered_widgets[ $widget_id ]['callback'] ) ) {
$wp_registered_widgets[ $widget_id ]['_callback'] = $wp_registered_widgets[ $widget_id ]['callback']; $wp_registered_widgets[ $widget_id ]['_callback'] = $wp_registered_widgets[ $widget_id ]['callback'];
$wp_registered_widgets[ $widget_id ]['callback'] = 'wp_widget_control'; $wp_registered_widgets[ $widget_id ]['callback'] = 'wp_widget_control';

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.3-alpha-46137'; $wp_version = '5.3-alpha-46138';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.