get_cat_ID() returns term_id rather than term_taxonomy_id
|Reported by:||GeorgeStephanis||Owned by:|
Description (last modified by scribu)
get_cat_ID() currently returns the wrong value for a category id. It's giving the term id rather than the term taxonomy id.
As the category ID is the term_taxonomy_id -- I believe that this is just legacy code from before the term_id and term_taxonomy_id were separated.
However, if your site is not running a straight 1:1 ratio for term_id = term_taxonomy_id (as some aren't) it will not give you the correct category id.
have it return ->term_taxonomy_id; instead of ->term_id;
Change History (4)
comment:2 @GeorgeStephanis — 4 years ago
- Summary changed from get_the_ID() returns term_id rather than term_taxonomy_id to get_cat_ID() returns term_id rather than term_taxonomy_id