[wp-trac] [WordPress Trac] #34243: Make `get_taxonomy()` work like `get_post_type()`
WordPress Trac
noreply at wordpress.org
Sat Oct 10 21:20:17 UTC 2015
#34243: Make `get_taxonomy()` work like `get_post_type()`
--------------------------------------------+------------------------------
Reporter: flixos90 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: trunk
Severity: normal | Resolution:
Keywords: dev-feedback 2nd-opinion close | Focuses:
--------------------------------------------+------------------------------
Comment (by DrewAPicture):
Replying to [comment:3 flixos90]:
> The issue I have is more about conventions than functionality. The
change you proposed in #34245 will indeed allow to get the taxonomy for a
term ID with a single function, so that covers the functionality aspect.
But wouldn't it be straightforward to structure the function names of term
functions in the same way like their post equivalents?
I understand what you're asking for. The primary issue is that
`get_taxonomy()` has been around for a ''long'' time, and has default
expected behavior we can't change – back-compat rules there.
Even if we added a `$term` parameter to add an additional return type (the
taxonomy name), you'd still have to pass a `$taxonomy` value to it. I
recognize what you're trying to do, but whatever solution we come up with,
it's probably not going to be called `get_taxonomy()`.
Best bet is something like `get_taxonomy_name()`, which would likely just
be a wrapper for `get_term_field( 'taxonomy', $term )` in the end, which
is partially why I opened #34245.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34243#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list