[wp-trac] [WordPress Trac] #14162: Introduce WP_Term

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 30 23:58:57 UTC 2010


#14162: Introduce WP_Term
-------------------------+--------------------------------------------------
 Reporter:  scribu       |       Owner:                 
     Type:  enhancement  |      Status:  new            
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Taxonomy     |     Version:                 
 Severity:  normal       |    Keywords:                 
-------------------------+--------------------------------------------------
 In the current taxonomy API, you end up having to pass the taxonomy name
 over and over again.

 I propose we have a WP_Term class to avoid that.

 === Example ===

 Current:

 `get_term_link( get_term_by( 'name', 'Term Name', 'taxname' ), 'taxname'
 )`

 Proposed:

 `get_term_by( 'name', 'Term Name', 'taxname' )->get_link()`

 get_term_by() would return a WP_Term instance instead of a stdClass
 instance.

 Besides get_link(), the WP_Term class could also have an update() method
 that would replace (or complement) wp_update_term().

 Inspired by #14156.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14162>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list