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

WordPress Trac noreply at wordpress.org
Sat Oct 10 18:39:44 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 flixos90):

 @DrewAPicture:
 I was rather asking for a function `get_taxonomy()` which works like
 `get_post_type()` because it would be more standardized and easier to
 understand I think. Now that term IDs are globally unique, they could
 basically have similar functions like posts have.
 For example we have:
 * `get_post()` and `get_term()`
 * `get_post_field()` and `get_term_field()`
 * `get_post_meta()` and `get_term_meta()`

 When I look at the names of those, I immediately get what they do. So when
 I see function names like `get_post_type()` and `get_taxonomy()` I would
 expect them to have a similar functionality as well, one for posts and the
 other for terms, but here it isn't the case. The same applies to
 `get_post_type_object()` where I would expect that there also exists a
 function called `get_taxonomy_object()` that does the same thing for
 terms, but that function is currently called `get_taxonomy()`.

 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?

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


More information about the wp-trac mailing list