[wp-trac] [WordPress Trac] #34243: Make `get_taxonomy()` work like `get_post_type()`

WordPress Trac noreply at wordpress.org
Sat Oct 10 15:31:09 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:
--------------------------------------------+------------------------------
Changes (by DrewAPicture):

 * keywords:  dev-feedback 2nd-opinion => dev-feedback 2nd-opinion close


Comment:

 `get_taxonomy()` isn't inherently the same concept as retrieving a post
 type and I'm not sure I'd expect it to return anything other than a
 taxonomy object.

 I've opened #34245 to make the `$taxonomy` parameter in `get_term_field()`
 optional now that `$taxonomy` is also now optional in `get_term()`.

 I think leveraging an existing function like `get_term_field()` should
 suffice for this need:
 {{{#!php
 $taxonomy = get_term_field( 'taxonomy', $term );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34243#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list