How would I go about requiring each post to have no more than one tag?
I would like to require the user to create a tag or choose one previous tag for each post. If you could give me any information, that would be very helpful.
|
How would I go about requiring each post to have no more than one tag? I would like to require the user to create a tag or choose one previous tag for each post. If you could give me any information, that would be very helpful. |
|||
|
|
|
Have fun. This works for any post type (including customs) that supports the 'post_tag' taxonomy. 99.9% of the time, it will apply only to 'post' post type. But we make compatible stuff ;)
Tested code. PHP 5.3+ Closures used. Convert code yourself to PHP 5.2 compatible variant if you need. Regards. |
|||||||||||
|
|
I know this post is old, but here is a nice plugin that has a ton of different posting requirements options, including min/max number of tags and categories, min/max length of content and title, require featured image, max number of links in the post and more - WyPiekacz I use this plugin on all of my multi-author sites. |
|||||||
|
|
Override the tag MetaBox and set only a text field that will be that single Tag. On updates, delete old tags and add new. If you still need help I could produce some code... |
|||||
|