Skip to content

Commit 97582ef

Browse files
authored
Fix undefined array key warning in Scheduler::async_batch (#2497)
1 parent a98c4a2 commit 97582ef

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
Undefined array key warning in Scheduler::async_batch when called without arguments.

includes/class-scheduler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ public static function async_batch() {
472472

473473
self::lock( $key );
474474

475-
if ( \is_callable( $args[0] ) ) {
475+
if ( \is_callable( $args[0] ?? null ) ) {
476476
$callback = \array_shift( $args ); // Remove $callback from arguments.
477477
}
478478
$next = \call_user_func_array( $callback, $args );

0 commit comments

Comments
 (0)