Display All Scheduled Events (Corn Jobs)

Advertisement

Description Description

By using the funciton wp_get_schedules () to get all the scheduled events OR corn jobs.

Note: Use below code snippet for ONLY debugging/development purpose.

Top ↑

Code Snippet Code Snippet

<?php
/**
* Show all scheduled events OR corn jobs.
*
* NOTE: Use this snippet for only debugging purpose.
*
* @todo Change the `prefix_` and with your own unique prefix.
*
* @since 1.0.0
*/
if( ! function_exists( 'prefix_show_all_scheduled_events' ) ) :
function prefix_show_all_scheduled_events() {
echo "<pre>";
print_r( wp_get_schedules() );
echo "</pre>";
wp_die( );
}
add_action( 'admin_head', 'prefix_show_all_scheduled_events' );
endif;

Top ↑

Output Output

Array
(
    [wp_import_astra_single_site_cron_interval] => Array
        (
            [interval] => 300
            [display] => Every 5 Minutes
        )
    [wp_import_astra_images_site_cron_interval] => Array
        (
            [interval] => 300
            [display] => Every 5 Minutes
        )
    [wp_import_astra_site_terms_cron_interval] => Array
        (
            [interval] => 300
            [display] => Every 5 Minutes
        )
    [wp_import_astra_sites_cron_interval] => Array
        (
            [interval] => 300
            [display] => Every 5 Minutes
        )
    [hourly] => Array
        (
            [interval] => 3600
            [display] => Once Hourly
        )
    [twicedaily] => Array
        (
            [interval] => 43200
            [display] => Twice Daily
        )
    [daily] => Array
        (
            [interval] => 86400
            [display] => Once Daily
        )
)

Leave a Reply