From 60f027a378101e0f0c1dd5db198db1c75e587ee0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 15 Sep 2019 11:45:56 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@46139 git-svn-id: http://core.svn.wordpress.org/trunk@45951 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-hook.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-hook.php b/wp-includes/class-wp-hook.php index d7e8628c2f..abae430a9e 100644 --- a/wp-includes/class-wp-hook.php +++ b/wp-includes/class-wp-hook.php @@ -259,6 +259,7 @@ final class WP_Hook implements Iterator, ArrayAccess { * * @param mixed $value The value to filter. * @param array $args Additional parameters to pass to the callback functions. + * This array is expected to include $value at index 0. * @return mixed The filtered value after all hooked functions are applied to it. */ public function apply_filters( $value, $args ) { @@ -282,7 +283,7 @@ final class WP_Hook implements Iterator, ArrayAccess { // Avoid the array_slice if possible. if ( $the_['accepted_args'] == 0 ) { - $value = call_user_func_array( $the_['function'], array() ); + $value = call_user_func( $the_['function'] ); } elseif ( $the_['accepted_args'] >= $num_args ) { $value = call_user_func_array( $the_['function'], $args ); } else { diff --git a/wp-includes/version.php b/wp-includes/version.php index 09e2c14da8..2594486966 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-46138'; +$wp_version = '5.3-alpha-46139'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.