Filters the array of categories to return for a post.
Parameters
$categoriesWP_Term[]- An array of categories to return for the post.
$post_idint|false- The post ID.
Source
return apply_filters( 'get_the_categories', $categories, $post_id );
Filters the array of categories to return for a post.
$categoriesWP_Term[]$post_idint|falsereturn apply_filters( 'get_the_categories', $categories, $post_id );
You must log in before being able to contribute a note or feedback.
Remove certain categories from being display on post loop for a specific post.
Assume we want to remove categories with slug
cat-slug-aandcat-slug-bfor post with ID5