WordPress.org

Support

Support » Plugins and Hacks » Author Category » [Resolved] Feature request – defined number of avaialable categories

[Resolved] Feature request – defined number of avaialable categories

  • I have a kind feature request. I wish authors could be able to select ie. 1, 2 or 3 categories from all categories available but no more than 3. If 3 selected, the rest becomes “dimmed” – impossible to select. The number of categories available per author could be set up in the plugin settings. What about that?

    http://wordpress.org/extend/plugins/author-category/

Viewing 1 replies (of 1 total)
  • Plugin Author Bainternet

    @bainternet

    Not really the functionality of this plugin but you can do that with this simple jQuery snippet

    add_action('admin_footer-post-new.php','limit_category_selection_count');
    add_action('admin_footer-post.php','limit_category_selection_count');
    function limit_category_selection_count(){
    	$limit = 2; //change this to the number you want to limit
    	?>
    	<script type="text/javascript">
    	jQuery(document).ready(function($){
    		$("input[type=checkbox][name^='post_category']").click(function() {
    		    var bol = $("input[type=checkbox][name^='post_category']:checked").length >= <?pphp echo $limit; ?>;
    		    $("input[type=checkbox][name^='post_category']").not(":checked").attr("disabled",bol);
    		});
    	});
    	</script>
    	<?php
    }
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Feature request – defined number of avaialable categories’ is closed to new replies.
Skip to toolbar