Dashboard > Category filter does not work after new category (1 post)

  1. wzshop
    Posted 3 years ago #

    Hello everyone,
    I created this filter to exclude the possibility for admins to create a parent category:

    function no_parent_category() {
    	 global $pagenow, $post;
        if(($pagenow == 'post.php' || $pagenow == 'post-new.php') && $post->post_type=='blog')
     <script type="text/javascript">
                 $('#newcategory_parent option[value=-1]').remove();
    add_action('admin_head', 'no_parent_category');

    This works great, but if an admin create a new subcategory (i.e. on the post-new.php page) in the category "floatbox", the option to create a parent category shows up again.

    Does anybody know why this is the case and how to prevent it from showing up?

Topic Closed

This topic has been closed to new replies.

About this Topic