Opened 11 months ago
Last modified 9 months ago
#21200 new defect (bug)
get_all_category_ids() only used by a deprecated function
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Taxonomy | Version: | 3.4.1 |
| Severity: | minor | Keywords: | needs-patch |
| Cc: |
Description
The function "get_all_category_ids()" (category.php) is only used by the deprecated function "get_category_children". I got two ideas for the future of the function:
a) also deprecate it
b) create a function "get_all_taxonomy_ids($taxonomy)". Since it seems to be a common problem for programmers to get e.g. all tag ids I would prefer this.
Attachments (1)
Change History (3)
Hi guys-- here's a patch file, would appreciate if someone could skim it quickly to make sure I did it correctly.
comment:2
wonderboymusic — 9 months ago
the function is simplified here: #21760, although not completely deprecated
Note: See
TracTickets for help on using
tickets.

The actual querying of the ids is done via get_terms() anyway:
$cat_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') );The only benefit of get_all_category_ids() is that it caches the ids. However, that cache doesn't seem to be invalidated anywhere, so it's buggy.
Therefore, I say we deprecate it.