How to customize the Categories meta box to allow only one category?

I’m trying to customize the Categories meta-box when adding a post.

screenshot

Read More

I have added a custom post and I need the administrator to post a new post without the ability to use the top level categories and also, he can just choose only one category, no more than one category!

Related posts

Leave a Reply

2 comments

  1. Freed from comment; the asker really did not want to write an answer. :/

    function convert_root_cats_to_radio()
    {
        global $post_type; 
        ?> 
    <script type="text/javascript"> 
    jQuery("#activitycategorychecklist>li>label input").each(function(){ 
        this.disabled = "disabled"; 
    }); 
    jQuery("#activitycategorychecklist>li>ul>li>label input").each(function(){ 
        this.type = 'radio'; 
    }); 
    jQuery("#activitycategory-tabs li:odd").hide(); 
    </script> <?php
    } 
    add_action( 'admin_footer-post.php',     'convert_root_cats_to_radio' ); 
    add_action( 'admin_footer-post-new.php', 'convert_root_cats_to_radio' );