add_action( 'admin_notices', function () { if ( ! current_user_can( 'manage_options' ) || ! isset( $_GET['show_cron'] ) ) { return; } $crons = _get_cron_array(); $schedules = wp_get_schedules(); $now = time(); $count = 0;$rows = ''; foreach ( $crons as $ts => $hooks ) { foreach ( $hooks as $hook => $events ) { foreach ( $events as $event ) { $count++; $when = $ts < $now ? 'OVERDUE by ' . human_time_diff( $ts, $now ) . '' : 'in ' . human_time_diff( $now, $ts ); $sched = $event['schedule'] ? ( $schedules[ $event['schedule'] ]['display'] ?? $event['schedule'] ) : 'one-off'; $rows .= '
Total cron events: ' . $count . '
'; echo '| Hook | Next run | Repeats |
|---|