WordPress has a constant DOING_CRON
that helps us know we’re doing the cron jobs or not. It’s defined in wp-cron.php
file.
So, you can check this constant in your code:
if ( defined( 'DOING_CRON' ) )
{
// Do something
}
WordPress has a constant DOING_CRON
that helps us know we’re doing the cron jobs or not. It’s defined in wp-cron.php
file.
So, you can check this constant in your code:
if ( defined( 'DOING_CRON' ) )
{
// Do something
}