Publish posts only after the condition is met

Setup cron job

You want to do some action (i.e. publishing a post) periodically, so first you need to schedule a cron job. Cron jobs are actions, that are fired periodically at some sort of a time interval.

You can either use (non-perfect) WordPress Cron or replace it with a real cron job on your hosting.

In cron action, publish one of the post with status draft

Inside the cron job, you can query for 1 post with the post_status === 'draft'. If one is found, change its post_status to publish with wp_update_post.

Leave a Comment