tags:

views:

26

answers:

2

I have a WordPress install in which registered users are allowed to post articles. The problem lies in the Tags section. I like the idea of letting them add tags, but it's getting crazy. Often there are 3 or 4 of the same tag just spelled differently, sometimes people put weird stuff for tags, etc. I'd like to be able to allow "adding" of tags to the posts, but not actual "creation" of the tag itself - I want the user to have to pick from a pre-determined list. That list could be a drop-down menu, some fancy jQuery thing, I really don't care. Open to ideas/suggestions. Something maybe how StackOverflow does it? Thanks!

+2  A: 

Are you able to use categories instead of tags? This would be easier to do by pre-loading categories and restricting users to a role that can't create categories.

If you really want to stick with tags, I think you'll have to search through Adam R Brown's list of action hooks and locate the hook that fires when a tag is added.

If an appropriate action hook isn't available, You could add your own.

I BELIEVE that tags are added by _wp_ajax_add_hierarchical_term() in wp-admin/admin-ajax.php and that is where you would add the custom hook. Look through the code in the trac page for the file. See if it makes sense and test it out.

kevtrout
Thank you for the direction. I will look into the hook there. I need to stick with tags. Categories are already used (and predefined) and tags are extras.
RodeoRamsey
+1  A: 

Since no one else answered this question with a simple to use snippet, and since it is beyond my ability to write my own code, I am choosing an answer based on knowledge that is above me.

RodeoRamsey