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
This commit is contained in:
parent
d55f1f81c7
commit
6e39938fb5
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -1050,7 +1050,7 @@ final class WP_Customize_Widgets {
|
|||
$args[0]['before_widget_content'] = '<div class="widget-content">';
|
||||
$args[0]['after_widget_content'] = '</div><!-- .widget-content -->';
|
||||
ob_start();
|
||||
call_user_func_array( 'wp_widget_control', $args );
|
||||
wp_widget_control( ...$args );
|
||||
$control_tpl = ob_get_clean();
|
||||
return $control_tpl;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue