Scheduled Posts and wp-cron – Why don’t scheduled posts publish if too old?

I notice that the documentation for wp_schedule_single_event mentions the following:- The action will fire off when someone visits your WordPress site, if the schedule time has passed. However this does not seem to be true for scheduled posts. I notice that some posts can be missed if wp-cron is not run for a while (not … Read more

Make future posts visible to the public—not just within WP_Query

I know I can publicly show future posts in a loop using ‘post_status’ => ‘future’ in WP_Query. But clicking on a future post’s permalink will result in a 404 if you are not a logged-in user. Suppose I have a post called Apocalypse in the post_type ‘event’, scheduled for 12-12-2099. The permalink is mysite.com/event/apocalypse. Is … Read more

Why doesn’t wp_update_post() update the post_status field?

I’m using this bit to insert/update a custom post type from the front-end. The date is set from a custom jquery datepicker. if (strtotime($date) < strtotime(‘tomorrow’)) { $newpostdata[‘post_status’] = ‘publish’; } elseif (strtotime($date) > strtotime(‘today’)) { $newpostdata[‘post_status’] = ‘future’; $newpostdata[‘post_date’] = date(‘Y-m-d H:i:s’, strtotime($date)); } if (‘insert’ == $operation) { $err = wp_insert_post($newpostdata, true); } … Read more