Set Category programatically

This topic contains 1 reply and 1 voices, and was last updated by gribbler 10 years, 3 months ago
Viewing 1 Posts - 1 through 1 (of 1 total)
Author Posts
December 21, 2013 at 5:11 am 13853
gribbler I'm looking to set the category on posting based on some logic within other fields in the post. I've looked at http://tareq.wedevs.com/2012/04/how-to-extend-wp-user-frontend/ specifically wpuf_add_post_args and I can set my user. I have 3 categories, with ID's 1, 3 & 5. I've tried setting the default in the dashboard to be 1 (uncategorized) and in the add_post_args I added: $my_post['category'] = array( 5 ); It seems to have no affect.
December 21, 2013 at 5:20 am 13858
gribbler gribbler

looks like I need to use
post_category instead df category

Hope this helps someone!

Viewing 1 Posts - 1 through 1 (of 1 total)