[wp-trac] [WordPress Trac] #38323: Reconsider $object_subtype handling in `register_meta()`

WordPress Trac noreply at wordpress.org
Wed Apr 5 21:44:32 UTC 2017


#38323: Reconsider $object_subtype handling in `register_meta()`
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Options, Meta APIs                   |  Review
 Severity:  normal                               |     Version:
 Keywords:  has-patch needs-unit-tests 2nd-      |  Resolution:
  opinion                                        |     Focuses:  rest-api
-------------------------------------------------+-------------------------

Comment (by jnylen0):

 I'm still not really convinced that this inheritance chain is a useful
 abstraction:

 - Does `WP_User` also inherit from `WP_Object_Type`?  Probably not, but
 doesn't this indicate that `WP_Object_Type` is not actually an ancestor
 class of all the things it describes?
 - What is the functionality that's being factored out into the base class?
 It needs to be common to as many object types as possible, at least the
 classes that inherit from it.
 - What if, in the future, we wanted to support registering meta for
 multiple object types at once (e.g. `post` of a certain type '''and'''
 `user`)?  Even if we don't implement this right away, this seems like
 another place where this abstraction falls apart.

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


More information about the wp-trac mailing list