Limit the number of Tags added to a Post
-
Hi,
I run an Article directory from wordpress and the registered users always go overboard when adding tags. I don’t display tags on the theme but use tags to determine what other posts are related to it.
I want to be able to limit the number of tags added to a new post to 3 but I cant find a hack or plugin on Google to do it.
Here is a js hack from a plugin that displays an alert if the user tries to select more than 1 category and it works great. Shouldnt it work the same for tags, if so, can someone edit this code for me and get it to work with tags also.
<script type="text/javascript"><!-- jQuery("form#post").submit(function(){ var ln = jQuery("ul#categorychecklist input:checkbox:checked").length; if ( ln > 1 ) { alert("<?php _e('Attention! You can select only ONE category.', 'article-directory'); ?>"); return false; } else { return true; } }); jQuery('#categorychecklist label').click(function(){ var ln = jQuery("ul#categorychecklist input:checkbox:checked").length; if ( ln > 1 ) { alert("<?php _e('Attention! You can select only ONE category.', 'article-directory'); ?>"); return false; } else { return true; } }); //--></script>
Thanks to anybody that can help.
Bob
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Limit the number of Tags added to a Post’ is closed to new replies.