Make WordPress Core

Opened 13 years ago

Closed 11 years ago

#21200 closed defect (bug) (fixed)

get_all_category_ids() only used by a deprecated function

Reported by: latz's profile Latz Owned by:
Milestone: 4.0 Priority: normal
Severity: minor Version: 3.4.1
Component: Taxonomy Keywords: has-patch easy-fix
Focuses: 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 (2)

21200.patch (1.6 KB) - added by winterDev 13 years ago.
Hi guys-- here's a patch file, would appreciate if someone could skim it quickly to make sure I did it correctly.
21200.2.diff (796 bytes) - added by MikeHansenMe 11 years ago.
adds _deprecated_function

Download all attachments as: .zip

Change History (6)

#1 @scribu
13 years ago

  • Keywords needs-patch added

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.

@winterDev
13 years ago

Hi guys-- here's a patch file, would appreciate if someone could skim it quickly to make sure I did it correctly.

#2 @wonderboymusic
12 years ago

the function is simplified here: #21760, although not completely deprecated

#3 @wonderboymusic
11 years ago

  • Keywords has-patch easy-fix added; needs-patch removed
  • Milestone changed from Awaiting Review to 4.0

@MikeHansenMe
11 years ago

adds _deprecated_function

#4 @SergeyBiryukov
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [28679].

Note: See TracTickets for help on using tickets.