Support » Plugins » creating a scheduled post with wp_insert

  • Hi, I import data from csv file.
    I want to create posts programmatically, and using wp_insrt I cannot see a “scheduled” post-status.
    I see.

    ‘post_date’ => [ Y-m-d H:i:s ] //The time post was made.
    ‘post_date_gmt’ => [ Y-m-d H:i:s ] //The time post was made, in GMT.
    ‘post_status’ => [ ‘draft’ | ‘publish’ | ‘pending’| ‘future’ | ‘private’ | custom registered status ] //Set the status of the new post.

    If I use “future’ in my array, I do not get a scheduled post.. I just get a ‘published” post.

    The wanted result is a scheduled post, say an hour from NOW !
    Any help?

Viewing 1 replies (of 1 total)
  • oops, sorry.. that should have been using wp_update($post).

    There is a bug here I think.
    I have not tested the wp_insert yet… but with wp_update the bug is:
    if a post already exists and is published, using wp_update to change status does not work. Time is changed to future, but post remains “published”.

    i.e. setting a previously published post to “scheduled in the future” will not work.

Viewing 1 replies (of 1 total)
  • The topic ‘creating a scheduled post with wp_insert’ is closed to new replies.