[wp-trac] [WordPress Trac] #35658: Provide additional data for registered meta through register_meta()

WordPress Trac noreply at wordpress.org
Tue Jun 28 05:37:56 UTC 2016


#35658: Provide additional data for registered meta through register_meta()
-------------------------------------------------+-------------------------
 Reporter:  jeremyfelt                           |       Owner:  jeremyfelt
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.6
Component:  Options, Meta APIs                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  needs-unit-tests needs-testing has-  |     Focuses:
  patch rest-api                                 |
-------------------------------------------------+-------------------------

Comment (by jtsternberg):

 As lead dev of CMB2 and dealing with lots and lots of meta for all object
 types, I would tend to agree with @MikeSchinkel here that we should
 probably attempt to handle the sub-typing a bit more elegantly if
 possible. (single responsibility principle and all that)

 Mike, I like your patch, but there does seem to be some opinionated stuff
 in the WP_Object_Type class (like all the `$_short_types` related
 business) that may be overkill for getting an MVP in to core. I'm also
 curious if we really '''need''' to support all the different methods for
 instantiation. Seems it would be prudent to limit that to a specific set
 like either a colon-separated string or array with `'type'` and
 `'subtype`' keys.

 Also, can we pretty please NOT do `final` on the class? (Mike, I know
 you're likely doing that to mirror existing core classes, but I'm hoping
 we can avoid it anyway). For instance, what if I wanted to extend this
 class for use in CMB2? Well.. I couldn't.

 Also, nit-picky, but would prefer `is_type_*` methods over `is_*_type` so
 as to avoid confusion with `is_post_type`.

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


More information about the wp-trac mailing list