Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wp-seopress/bbcb79e69ea39d985272b57f4df90b0f to your computer and use it in GitHub Desktop.
Save wp-seopress/bbcb79e69ea39d985272b57f4df90b0f to your computer and use it in GitHub Desktop.
Filter primary categories / product categories list
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');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment