Support » Fixing WordPress » Inject a post into wordpress

  • 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?

Viewing 1 replies (of 1 total)
  • 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

Viewing 1 replies (of 1 total)
  • The topic ‘Inject a post into wordpress’ is closed to new replies.