WordPress.org

Make WordPress Core

Changeset 46139


Ignore:
Timestamp:
09/15/2019 11:44:09 AM (2 months ago)
Author:
SergeyBiryukov
Message:

Code Modernisation: Replace call_user_func_array() in combination with an empty array in wp-includes/class-wp-hook.php with call_user_func().

Props jrf.
See #47678.

File:
1 edited

Legend:

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

    r46082 r46139  
    260260     * @param mixed $value The value to filter.
    261261     * @param array $args  Additional parameters to pass to the callback functions.
     262     *                     This array is expected to include $value at index 0.
    262263     * @return mixed The filtered value after all hooked functions are applied to it.
    263264     */
     
    283284                // Avoid the array_slice if possible.
    284285                if ( $the_['accepted_args'] == 0 ) {
    285                     $value = call_user_func_array( $the_['function'], array() );
     286                    $value = call_user_func( $the_['function'] );
    286287                } elseif ( $the_['accepted_args'] >= $num_args ) {
    287288                    $value = call_user_func_array( $the_['function'], $args );
Note: See TracChangeset for help on using the changeset viewer.