wp_insert_post() : I can’t get the post to the correct category
-
Hi I am actually trying to modify the TDO-Miniforms which uses wp_insert_post() to add a post.
I am trying to make the form to post to the specific category on the page.
I extract the category by reading the querystring. I have checked that the string value of the category is correctly extracted. However, after using wp_insert_post(), the post is being posted to the default category set in wp admin. Can anyone identify the problem? I suspect the wp_insert_post() has changed the category to the default that was set. Does the $post_category attribute in wp_insert_post() function reads this value correctly?
How can I correct this problem?
Thank you for anyone trying to help.
- The topic ‘wp_insert_post() : I can’t get the post to the correct category’ is closed to new replies.