Taxonomy and Term Queries
When dealing with taxonomies ( including post categories and tags ), it's safer to rely on the generic APIs rather than the legacy helper APIs. These include:
get_taxonomiesget_termsget_term_byget_taxonomywp_get_object_termswp_set_object_terms
It's easier to learn one set of APIs, and think of categories and tags as just another taxonomy, rather than mixing and matching older functions such as get_category etc.
Last updated