Merge pull request #28537 from garyc40/fix/update-callback-named-parameter

[PHP 8] Fix Unknown named parameter error when running database update routines
This commit is contained in:
Vedanshu Jain 2020-12-23 14:28:54 +05:30 committed by GitHub
commit f46af1160f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -221,16 +221,17 @@ class WC_Install {
/**
* Run an update callback when triggered by ActionScheduler.
*
* @param string $update_callback Callback name.
*
* @since 3.6.0
* @param string $callback Callback name.
*/
public static function run_update_callback( $callback ) {
public static function run_update_callback( $update_callback ) {
include_once dirname( __FILE__ ) . '/wc-update-functions.php';
if ( is_callable( $callback ) ) {
self::run_update_callback_start( $callback );
$result = (bool) call_user_func( $callback );
self::run_update_callback_end( $callback, $result );
if ( is_callable( $update_callback ) ) {
self::run_update_callback_start( $update_callback );
$result = (bool) call_user_func( $update_callback );
self::run_update_callback_end( $update_callback, $result );
}
}