//Get all terms by taxonomy slug
function get_all_terms_by_taxonomy($taxonomy) {
$terms = get_terms([
'taxonomy' => $taxonomy,
'hide_empty' => false,
]);
return $terms;
}
// Example usage:
$district_terms = get_all_terms_by_taxonomy('district');
0 Comments
Post a Comment