Home Forums Plugin Support WP User Frontend (Free Version) Set Category programatically

This topic is: resolved

This topic contains 1 reply, has 1 voice, and was last updated by  gribbler 5 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #13853

    Post count: 4

    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.


    Post count: 4

    looks like I need to use
    post_category instead df category

    Hope this helps someone!

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Set Category programatically’ is closed to new replies.