Check if function called by cron job

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
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)