WordPress.org

Make WordPress Core

Opened 20 months ago

Last modified 20 months ago

#36399 new enhancement

Change function signature of `wp_count_terms()` to be compliant with recent `get_terms()` changes

Reported by: flixos90 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.6
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description

In #35495 the $taxonomy parameter of get_terms() was made optional, thus changing the function signature to the first parameter being the $args array where the taxonomy (if needed) could then be added to.

This ticket is about changing the signature of wp_count_terms() in a similar manner. This will bring more consistency and it will also allow to count all terms entirely (if no taxonomy is provided).

Attachments (1)

36399.diff (2.4 KB) - added by flixos90 20 months ago.

Download all attachments as: .zip

Change History (5)

@flixos90
20 months ago

#1 @flixos90
20 months ago

  • Keywords has-patch added

36399.diff is a patch for this. Specifically we need to determine if the check for $do_legacy_args is safe enough here. As an alternative, we could create a new internal function like _get_terms_defaults() which would allow us to do the same kind of verification as in get_terms().

#2 @chriscct7
20 months ago

  • Version trunk deleted

#3 @ocean90
20 months ago

  • Version set to trunk

#4 @chriscct7
20 months ago

  • Summary changed from Change function signature of `wp_count_terms()` to be comliant with recent `get_terms()` changes to Change function signature of `wp_count_terms()` to be compliant with recent `get_terms()` changes
Note: See TracTickets for help on using tickets.