A related WPSE question asks how to get the term by specifying ID only, without specifying taxonomy. My question is more philosophical. Generally, stuff in WP core is there for a reason. I'm trying to understand why term_id can't be the primary key for the term - why do we need the taxonomy as well? Can a single term record be a member of multiple taxonomies? That's certainly not currently supported in the API. Is there a use case where this might be desirable?
Or is the required $taxonomy
parameter in get_term()
a vestigial tail from an earlier incarnation of the database structure?
wp_term_taxonomy
table is used as index for that table, which make the query faster (even if its just a term).EXPLAIN
saysterm_id
.