Does DISABLE_WP_CRON prevent plugins from registering new cron tasks?

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 … Read more

Running one-off cron jobs when WP_DISABLE_CRON is true: can I hit /wp-cron.php?

The WP_DISABLE_CRON constant only removes WP-Cron from loading on the page so it’s no longer triggered by site traffic. You can absolutely hit the wp-cron.php file directly to trigger it. I use https://cron-job.org to ping my private sites at https://dev.example.com/wp-cron.php?doing_wp_cron for example. This is actually recommended in the WordPress handbook: https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/ Editing to add: if … Read more

How does one programmatically manage posts from a external php script?

You can remotely create posts programmatically via XML-RPC e.g. PHP http://www.nickycakes.com/post-to-wordpress-remotely-with-xmlrpc-in-php/ Java http://code.google.com/p/wordpress-java/ Of note, the media library handles image EXIF data etc, it might be more convenient to switch from using posts to just displaying the latest uploaded attachments that do not have a parent post (attachments with a parent post are attached to … Read more

How to set-up multiple cron task with wp_schedule_event so that they do not overlap?

Ok that was pretty easy // Set the CRON for pages wp_schedule_event( current_time( ‘timestamp’ ) + 450, self::FB_CRON_FREQUENCY, self::FB_CRON_PAGES, array( Ai1ec_Facebook_Graph_Object_Collection::FB_PAGE ) ); // Set the CRON for groups wp_schedule_event( current_time( ‘timestamp’ ) + 900, self::FB_CRON_FREQUENCY, self::FB_CRON_GROUPS, array( Ai1ec_Facebook_Graph_Object_Collection::FB_GROUP ) ); // Set the CRON for users wp_schedule_event( current_time( ‘timestamp’ ) + 1350, self::FB_CRON_FREQUENCY, self::FB_CRON_USERS, … Read more

Cron job to call php to email last 24 hours posts

In your functions.php you can use this. You will have to activate your theme again for it to take effect. You only want to schedule a cron job on activation, not on activation NOT on every page load, which is what the functions.php does, it loads on every page load. This would be betterused in … Read more