Skip to content

Commit 3b7938e

Browse files
committed
Hardening if not an array
Avoid `Invalid argument supplied for foreach()` warnings
1 parent c342fd6 commit 3b7938e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Cron_Event_Command.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,10 @@ protected static function get_cron_events( $is_due_now = false ) {
610610
);
611611
}
612612

613+
if ( ! is_array( $crons ) ) {
614+
return [];
615+
}
616+
613617
foreach ( $crons as $time => $hooks ) {
614618

615619
// Incorrectly registered cron events can produce a string key.

0 commit comments

Comments
 (0)