I'm trying to get a list of categories if they are used in a Custom Post type. The post type uses the default categories taxonomy. There are also other custom post types that use the same default WP category.
Is it possible to add a meta_query that checks if the category is used in a Custom post_type? eq: custom post type: work.
$work_categorys = get_terms(
[
'taxonomy' => "category",
'hide_empty' => true,
]
);
foreach ($work_categorys as $key => $value) { echo '<li data-filter-tag="'.$value->slug.'" class="">'.$value->name.'</li>'; }