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

WordPress Trac noreply at wordpress.org
Wed Sep 9 11:37:03 UTC 2015


#14162: Introduce WP_Term class
--------------------------------------+---------------------------
 Reporter:  scribu                    |       Owner:  boonebgorges
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  4.4
Component:  Taxonomy                  |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  needs-patch dev-feedback  |     Focuses:
--------------------------------------+---------------------------
Changes (by flixos90):

 * keywords:  needs-patch => needs-patch dev-feedback


Comment:

 I created the patch above to have a starting point for the `WP_Term` class
 and its integration into its related term functions. I hope it's something
 we can build upon.

 Please note that all function calls still require specification of the
 taxonomy - removing this requirement is part of #30262 I think.

 One thing we should think about is which additional term properties and
 term functions we should make accessible using magic methods. Also whether
 we should rather use the `__get()` method (like in the patch) or include
 wrapper functions in the class instead (for example, should we be able to
 get the term link via `$term->link` or `$term->get_link()`?).

 Another thing that should probably be added to the class later is the
 functionality to get term meta using `__get()`, similar to how it is
 handled in `WP_Post`.

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


More information about the wp-trac mailing list