Inject a post into wordpress (2 posts)

  1. jeremyduffy
    Posted 8 years ago #

    I have a script that reads all images in a folder and I want to create a post for each image. I need to be able to specify the content and the category values, but I'm hoping that there's a WordPress function for this so I don't have to do it all manually. What can I do?

  2. jeremyduffy
    Posted 8 years ago #

    I've tried using wp_insert_post (found it online). But if I pass it an array or a custom class (per examples I've found), I get the same error:

    Fatal error: Cannot use object of type WP_Error as array in C:\blog\wp-includes\taxonomy.php on line 1014

Topic Closed

This topic has been closed to new replies.

About this Topic