[wp-hackers] Scheduling of future posts with a different post_type.

Otto otto at ottodestruct.com
Sun Jul 13 03:43:55 GMT 2008


check_and_publish_future_post checks that the post a) exists and b)
has a post_status = 'future'. If so, then it publishes it (using
wp_publish_post). If either fails, then nothing happens, the post is
left unchanged.

Step A is done by simply calling get_post($post_id) on your post. Does
that work properly? Check that get_post() returns your post info.

Step B is done by simply looking at the post_status of the gotten
post. Make sure it is still set to "future" properly.



On Sat, Jul 12, 2008 at 10:22 AM, Jason Webster <jason at intraffic.net> wrote:
> Hi Everyone,
>
> I seem to have reached an impasse with regards to delayed publishing in a
> plugin of mine.
> Here's the background:
>
> I have a new Write screen which uses all the existing Write post
> infrastructure (edit-form-advanced.php, post.php, etc.). All I do is make a
> few changes the default post object provided by get_default_post_to_edit()
> upon initialization. Specifically, I just set the post_type to a different
> string, and force comment_status to closed.
>
> The posts publish fine. They even seem to schedule fine. However, when it
> comes time for them to publish, status on the Manage screen stays
> "Scheduled" and the time starts displaying time since it should have
> published, although it retains the "from now" suffix.
>
> Regular posts schedule and publish just fine.
>
> Now, I have dug around a bunch, but haven't seen anything that would prevent
> a post with a different post type to no be published by the scheduler.
>
> Perhaps someone could point me in the right direction?
>
> I'm running 2.5.1, and have no other plugins, other than the one I'm working
> on, enabled.
>
> Thanks.
> -Jason
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list