Many times I have code and I want to make sure it only runs in a cron context, or it never runs in a cron context.
Is there an
is_cron_running style function?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
wp_doing_cron will return true if the current request is a WP Cron request, or if it's triggered from WP CLI