Support » Plugins » saving category info without using the built-in category admin widget?

  • Resolved iblastoff


    I am essentially working on a custom post type (for events) and need to properly save category info *without* using the default category widget.

    instead of the select boxes and allowing the backend user to choose however many categories they want, i want a dropdown box that only allows them to select ONE category from a restricted set of categories.

    so far i’ve been trying to implement the “wp_dropdown_categories” function and have been able to grab the proper categories i want and display them in my event custom post type edit page but i have no idea how to actually SAVE the post with the selected category.

    any code snippets/help would be greatly appreciated!

Viewing 6 replies - 1 through 6 (of 6 total)
  • heres a visual depiction of my dillemma

    (basically can’t get the dropdown of categories to save upon publish)

    i also need to overwrite any previous category the post has been saved in (so basically only one category per post)

    no one?


    Please, try to use this Default Author Category plugin.

    Hope this will resolve your issue. 🙂

    Thanks mr49online. I assume, iblastoff, that since you marked this “Resolved”, you’re all set here…but let me know if not.

    thanks for the reply but that plugin was not what i was looking for. perhaps i explained my issue in an unclear way but i have since resolved it on my own:

    // steve lam - allows category update via the events venue dropdown menu rather than the sidebar category widget which is hidden in the events custom post type. this is needed because the crappy events calendar plugin only supports regular categories
    function event_venue_category($post_ID) {
    	$campus_name = get_post_meta($post_ID, '_EventVenue', true);
    	$venue_name = get_post_meta($post_ID, '_venue_campus_specific', true);
    	$event_category = array(
    	wp_set_post_categories($post_ID, $event_category);

    Ah, excellent to hear you got this resolved on your own – great work. Thanks for sharing the solution too; hopefully other users who come to the forum with similar problems will find this valuable.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘saving category info without using the built-in category admin widget?’ is closed to new replies.