[wp-trac] [WordPress Trac] #48682: Introduce WP_Labels class

WordPress Trac noreply at wordpress.org
Sun Nov 17 11:24:49 UTC 2019


#48682: Introduce WP_Labels class
-------------------------+--------------------------------------
 Reporter:  alpipego     |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Taxonomy     |    Version:
 Severity:  normal       |   Keywords:  dev-feedback 2nd-opinion
  Focuses:               |
-------------------------+--------------------------------------
 Classes like `WP_Taxonomy` and `WP_Post_Type` return a `stdClass` object
 for the `$labels` property. The way this is done right now, it should be
 an array not an object.

 A solution would be to introduce an abstract `WP_Labels` class that holds
 all shared the properties (`name`, `singular_name`, `search_items`, etc.)
 and concrete classes, e.g. `WP_Taxonomy_Labels` for type-specific
 properties (`choose_from_most_used`, `separate_items_with_commas`, etc).

 see also #48681.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48682>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list