From 6e39938fb58b65fe5e1506c82f8126370658d0f0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 15 Sep 2019 11:27:55 +0000 Subject: [PATCH] Code Modernisation: Replace `call_user_func_array()` in `wp-includes/class-wp-customize-*.php` with direct function calls in combination with the spread operator. Props jrf. See #47678. Built from https://develop.svn.wordpress.org/trunk@46133 git-svn-id: http://core.svn.wordpress.org/trunk@45945 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-manager.php | 2 +- wp-includes/class-wp-customize-panel.php | 4 ++-- wp-includes/class-wp-customize-section.php | 4 ++-- wp-includes/class-wp-customize-setting.php | 4 ++-- wp-includes/class-wp-customize-widgets.php | 2 +- wp-includes/version.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 9cdd288aa5..1948e7a794 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -1229,7 +1229,7 @@ final class WP_Customize_Manager { $widget_numbers = array_keys( $settings ); if ( count( $widget_numbers ) > 0 ) { $widget_numbers[] = 1; - $max_widget_numbers[ $id_base ] = call_user_func_array( 'max', $widget_numbers ); + $max_widget_numbers[ $id_base ] = max( ...$widget_numbers ); } else { $max_widget_numbers[ $id_base ] = 1; } diff --git a/wp-includes/class-wp-customize-panel.php b/wp-includes/class-wp-customize-panel.php index 8a227cd70d..82eda3a0f6 100644 --- a/wp-includes/class-wp-customize-panel.php +++ b/wp-includes/class-wp-customize-panel.php @@ -224,11 +224,11 @@ class WP_Customize_Panel { * @return bool False if theme doesn't support the panel or the user doesn't have the capability. */ final public function check_capabilities() { - if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) { + if ( $this->capability && ! current_user_can( $this->capability ) ) { return false; } - if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) { + if ( $this->theme_supports && ! current_theme_supports( ... (array) $this->theme_supports ) ) { return false; } diff --git a/wp-includes/class-wp-customize-section.php b/wp-includes/class-wp-customize-section.php index ae90127cca..26313a7401 100644 --- a/wp-includes/class-wp-customize-section.php +++ b/wp-includes/class-wp-customize-section.php @@ -242,11 +242,11 @@ class WP_Customize_Section { * @return bool False if theme doesn't support the section or user doesn't have the capability. */ final public function check_capabilities() { - if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) { + if ( $this->capability && ! current_user_can( $this->capability ) ) { return false; } - if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) { + if ( $this->theme_supports && ! current_theme_supports( ... (array) $this->theme_supports ) ) { return false; } diff --git a/wp-includes/class-wp-customize-setting.php b/wp-includes/class-wp-customize-setting.php index 3e0a1c0770..08d5b1c348 100644 --- a/wp-includes/class-wp-customize-setting.php +++ b/wp-includes/class-wp-customize-setting.php @@ -815,11 +815,11 @@ class WP_Customize_Setting { * @return bool False if theme doesn't support the setting or user can't change setting, otherwise true. */ final public function check_capabilities() { - if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) { + if ( $this->capability && ! current_user_can( $this->capability ) ) { return false; } - if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) { + if ( $this->theme_supports && ! current_theme_supports( ... (array) $this->theme_supports ) ) { return false; } diff --git a/wp-includes/class-wp-customize-widgets.php b/wp-includes/class-wp-customize-widgets.php index 86cf889ee5..1a0ae316e9 100644 --- a/wp-includes/class-wp-customize-widgets.php +++ b/wp-includes/class-wp-customize-widgets.php @@ -1050,7 +1050,7 @@ final class WP_Customize_Widgets { $args[0]['before_widget_content'] = '
'; $args[0]['after_widget_content'] = '
'; ob_start(); - call_user_func_array( 'wp_widget_control', $args ); + wp_widget_control( ...$args ); $control_tpl = ob_get_clean(); return $control_tpl; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 5fead86957..46853eeac0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-46132'; +$wp_version = '5.3-alpha-46133'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.