[wp-hackers] Limiting ability to add terms to taxonomies

Mike Schinkel mikeschinkel at newclarity.net
Wed Dec 15 04:23:52 UTC 2010


On Dec 14, 2010, at 10:43 PM, William Davis wrote:
> I'd like to create a plugin that replaces the current meta boxes on the post edit page with a new meta box that restricts the ability to add terms to that taxonomy. The reason for this, if anyone was wondering, is because we use several custom taxonomies that are auto-linked in the articles but many people have access to edit the posts, so we need to make it a little harder to add a term so we don't end up with duplicate terms (such as President Barack Obama and Barack Obama).
> 
> My question is, is there an easy way to get an array of all the taxonomies that have meta boxes and unset those meta boxes?

You might be over-thinking this. Can you not just use CSS to remove the "Add" link?

This will handle using CSS if you put in your theme's functions.php file (or in one of the .PHP files for a plugin of your own):

add_action('admin_head','yoursite_admin_head');
function yoursite_admin_head() {
   echo '<style type="text/css">#category-add-toggle {display:none;}</style>';
}

Hope this helps.

-Mike



More information about the wp-hackers mailing list