Make WordPress Core

Opened 4 years ago

Last modified 10 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: Priority: normal
Severity: normal Version: 4.6
Component: Taxonomy Keywords: has-patch
Focuses: Cc:


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 4 years ago.

Download all attachments as: .zip

Change History (5)

4 years ago

#1 @flixos90
4 years 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
4 years ago

  • Version trunk deleted

#3 @ocean90
4 years ago

  • Version set to trunk

#4 @chriscct7
4 years 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.