Fix Unknown named parameter error on PHP 8

This commit is contained in:
Gary Cao 2020-12-10 15:21:34 +09:00 committed by GitHub
parent 15315d2468
commit e6a7f0f40a
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 );
}
}