WordPress.org

Ready to get started?Download WordPress

Forums

Timestamp a post - What Happens? (2 posts)

  1. pickledegg
    Member
    Posted 6 years ago #

    I've written a script that inserts a load of posts from an articles database into a wordpress database. The posts are given a timestamp that is staggered at a rate of approx 4 posts a day.

    The posts go in, but don't publish when the timestamp arrives, they just sit there in limbo.
    I know why they don't publish - THE CRON.

    I'm going up the wall trying to figure out what I have to code to tell the cron to deal with the post.

    Heres the script, I need to 'add each post to the cron'.

    I've been struggling on this for weeks, does anyone know how to add each post to the cron queue?

    http://pickledegg.orchardhostings6.co.uk/articletransfer.txt

    Thanks

  2. pickledegg
    Member
    Posted 6 years ago #

    I used this in the end

    http://codex.wordpress.org/Function_Reference/wp_insert_post

    But may I add that the documentation is WRONG, as it tells you to pass this:

    $post_category = array( 'post_category' => $parent_id );

    but in fact you must pass something like this:

    $post_category[0] = $parent_id;

    Do not name the key, it doesn't ******* work!

Topic Closed

This topic has been closed to new replies.

About this Topic