Remove custom taxonomy column from my custom post type columns

I am using wp 3.5 i have a custom post (sp_product) and also i have custom taxonomy. I want to remove that custom taxonomy filter column but i don’t want to make 'show_admin_column' => false.

I wanna unset from $columns[''] .

Read More

How should i do that ? i also want to add some css/js when it will show in column and top select menu. (showing in this image like)

enter image description here

Related posts

Leave a Reply

1 comment

  1. To hide columns in a Custom Post Type screen, you need the filter manage_{$this->screen->id}_columns.

    add_filter( 'manage_edit-sp_product_columns', 'hide_cpt_columns_so_14257172' );
    
    function hide_cpt_columns_so_14257172( $columns )
    {
        // Change categories for your custom taxonomy
        unset($columns['categories']);
        return $columns;
    }
    

    To add custom CSS/Javascript in a specific screen, you can use the action admin_head-$hook_suffix. The following code hides the Show all dates, View all categories and Filter elements:

    add_action( 'admin_head-edit.php', 'custom_css_js_so_14257172' );
    
    function custom_css_js_so_14257172() 
    {
        // Apply only in the correct CPT, otherwise it would print in Pages/Posts
        global $current_screen;
        if( 'sp_product' != $current_screen->post_type)
            return;
        ?>
            <style>
                select[name="m"] { display:none }
                select[id="cat"] { display:none }
                #post-query-submit { display:none }
            </style>
        <?php
    }