Is this assumption valid? Or does DISABLE_WP_CRON actually block crons from running, and block plugins from registering new cron events?
Yes, setting DISABLE_WP_CRON
to true
doesn’t actually block WordPress’ crons from running; it just prevents wordpress itself from initiating the events to run when your backend is triggered by a customer viewing your website.
I’m writing a plugin that tries to register a new cron event with
wp_schedule_event()
. The function returns True, but the new cron job does not appear in my event list, so I don’t think it will ever be executed by my system’s cron.
wp cron event list
will not list all of your crons if you’re using wordpress multisite.
I don’t know of a built-in way to get wp-cli
to just dump all of the crons for all of your sites, but here’s a simple bash loop that will iterate through each of your sites and list all scheduled cron events for each site.
urls=$(wp site list --field=url)
for url in $urls; do
echo ${url}
sudo cron --url=${url} event list
echo
done