Created
August 22, 2023 09:17
-
-
Save wp-seopress/bbcb79e69ea39d985272b57f4df90b0f to your computer and use it in GitHub Desktop.
Filter primary categories / product categories list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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