[wp-trac] [WordPress Trac] #35495: Allow `get_terms()` to return all terms, make `$taxonomy` parameter optional
WordPress Trac
noreply at wordpress.org
Sat Feb 20 10:37:47 UTC 2016
#35495: Allow `get_terms()` to return all terms, make `$taxonomy` parameter
optional
--------------------------------------+-----------------------------
Reporter: flixos90 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Taxonomy | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+-----------------------------
Changes (by swissspidy):
* keywords: has-patch => has-patch has-unit-tests
* milestone: Awaiting Review => Future Release
Comment:
Thanks for the patch! I was already mentally preparing myself to dive into
this, glad I don't have to now :-)
The logic looks good, though `$args = array(), $legacy_args = ''` sounds a
bit confusing. Can't we just name this parameter `$deprecated`, so that
it's clear you should really only use `get_terms( $args )`?
> `return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) );`
Is it possible to pass `$taxonomy` here, to make it obvious which taxonomy
is invalid?
Also, could we perhaps use `array_filter()` for these `taxonomy_exists()`
and `is_taxonomy_hierarchical()` checks? It should be just as fast and a
bit cleaner to read.
----
Note: We may still change the milestone to 4.5 if we get a commit-ready
patch
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35495#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list