[wp-trac] [WordPress Trac] #35495: Allow `get_terms()` to return all terms, make `$taxonomy` parameter optional
WordPress Trac
noreply at wordpress.org
Fri Feb 19 18:25:54 UTC 2016
#35495: Allow `get_terms()` to return all terms, make `$taxonomy` parameter
optional
-------------------------+------------------------------
Reporter: flixos90 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+------------------------------
Changes (by boonebgorges):
* keywords: needs-unit-tests needs-patch => has-patch
Comment:
[attachment:35495.2.diff] is a first pass at `get_terms( $args )`. When a
non-empty second param is passed to the function, or when an array is
passed to the first param that doesn't look like an `$args` array, the
function falls back on the old `get_terms( $taxonomies, $args )` format.
I don't see the possibility for conflicts between legacy and new arg
formats. If the second param is present, the first will be parsed as a
taxonomy array. `$legacy_args['taxonomy']` is effectively ignored. This
should result in total backward compatibility for anyone who happens to be
passing `$args['taxonomy']` in an existing plugin.
What do people think? Especially regarding the documentation. (ping
@DrewAPicture)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35495#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list