Jplus2
Jplus2

Reputation: 2531

Remove Category Description on Woocommerce Category Listing Page (Admin Area)

How do I remove categoy description from category listing page on woocommerce. I do not want to remove the adding of description functionality, I will use it, instead just remove it from the category listing (on the admin area), because I have lots of very long descriptions, and the doesn't look so good with the description included on the listing. Been searching on google for this, unfurtunately no luck.

Thanks in advance.

Upvotes: 1

Views: 4799

Answers (1)

Jplus2
Jplus2

Reputation: 2531

Remove both on woocommerce and wordpress default category listing page

/*========== Remove Category Column on Wordpress Category Listing Page ==========*/
function cap_remove_category_desc_cat_listing($columns)
{
// only edit the columns on the current taxonomy
if ( !isset($_GET['taxonomy']) || ($_GET['taxonomy'] != 'category' && $_GET['taxonomy'] != 'product_cat') )
    return $columns;

// unset the description columns
if ( $posts = $columns['description'] ){ unset($columns['description']); }

return $columns;
}
add_filter('manage_edit-category_columns','cap_remove_category_desc_cat_listing');
add_filter('manage_edit-product_cat_columns','cap_remove_category_desc_cat_listing');

Upvotes: 2

Related Questions