Make WordPress Core

Changeset 46133


Ignore:
Timestamp:
09/15/2019 11:26:16 AM (7 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src/wp-includes
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r45932 r46133  
    12301230                                        if ( count( $widget_numbers ) > 0 ) {
    12311231                                                $widget_numbers[]               = 1;
    1232                                                 $max_widget_numbers[ $id_base ] = call_user_func_array( 'max', $widget_numbers );
     1232                                                $max_widget_numbers[ $id_base ] = max( ...$widget_numbers );
    12331233                                        } else {
    12341234                                                $max_widget_numbers[ $id_base ] = 1;
  • trunk/src/wp-includes/class-wp-customize-panel.php

    r45932 r46133  
    225225         */
    226226        final public function check_capabilities() {
    227                 if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
     227                if ( $this->capability && ! current_user_can( $this->capability ) ) {
    228228                        return false;
    229229                }
    230230
    231                 if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) {
     231                if ( $this->theme_supports && ! current_theme_supports( ... (array) $this->theme_supports ) ) {
    232232                        return false;
    233233                }
  • trunk/src/wp-includes/class-wp-customize-section.php

    r45932 r46133  
    243243         */
    244244        final public function check_capabilities() {
    245                 if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
     245                if ( $this->capability && ! current_user_can( $this->capability ) ) {
    246246                        return false;
    247247                }
    248248
    249                 if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) {
     249                if ( $this->theme_supports && ! current_theme_supports( ... (array) $this->theme_supports ) ) {
    250250                        return false;
    251251                }
  • trunk/src/wp-includes/class-wp-customize-setting.php

    r45232 r46133  
    816816         */
    817817        final public function check_capabilities() {
    818                 if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
     818                if ( $this->capability && ! current_user_can( $this->capability ) ) {
    819819                        return false;
    820820                }
    821821
    822                 if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) {
     822                if ( $this->theme_supports && ! current_theme_supports( ... (array) $this->theme_supports ) ) {
    823823                        return false;
    824824                }
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r45932 r46133  
    10511051                $args[0]['after_widget_content']  = '</div><!-- .widget-content -->';
    10521052                ob_start();
    1053                 call_user_func_array( 'wp_widget_control', $args );
     1053                wp_widget_control( ...$args );
    10541054                $control_tpl = ob_get_clean();
    10551055                return $control_tpl;
Note: See TracChangeset for help on using the changeset viewer.