Need way to prohibit creation of new taxonomy terms

Description

I have site where everyone can submit post. I have created categories, which are usually used by people. Unfortunately from time to time I get post (probably added by some automated software), which is added to newly created category, which name consists of digits only. Therefore I need some way to disable this, e.g. new filter called at beginning of wp_insert_term(), which can be used to deny operation.

Change History (7)

I have a similar need, but this patch (attachment:taxonomy.php.diff​) has some limitations. If wp_insert_term returns a WP_Error than the wp_set_object_terms will return directly after with an error, causing none of the terms to be mapped to the object. I think a better solution would be the ability to filter our the new terms before the loop even begins.