Skip to content Skip to navigation
Back to the main support

Filter primary categories / product categories list

Hook name
seopress_primary_category_list
Required version
7.0
function sp_primary_category_list($cats) {
//default
//$cats = get_categories();
// global $typenow;
// global $post;
// if ('product' == $typenow) {
// $cats = get_the_terms($post_id, 'product_cat');
// }
return $cats;
}
add_filter('seopress_primary_category_list', 'sp_primary_category_list');
How-to use SEOPress hooks