harsh
Filed under - WordPress
No Comments so far. Add yours now

add_action( ‘admin_head-edit-tags.php’, ‘remove_child_taxonomy_selection_box’ );

function remove_child_taxonomy_selection_box()
{
// don’t run in the Tags screen
if ( ‘customposttype_name’ != $_GET['taxonomy'] )
return;

// Screenshot_1 = New Category
// http://example.com/wp-admin/edit-tags.php?taxonomy=category
$parent = ‘parent()’;

// Screenshot_2 = Edit Category
// http://example.com/wp-admin/edit-tags.php?action=edit&taxonomy=category&tag_ID=17&post_type=post
if ( isset( $_GET['action'] ) )
$parent = ‘parent().parent()’;
?>

jQuery(document).ready(function($)
{
checkval();
$(“#parent”).live(‘click’,function(){
checkval();
});
});
function checkval()
{
jQuery(“#parent option”).each(function(index){
if(!jQuery(this).hasClass(‘level-0′))
{
jQuery(this).remove();
}
});
}

<?php
}

Leave your comment

You must be logged in to post a comment.

Share IT © 2017. All rights reserved.