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

WordPress Trac noreply at wordpress.org
Fri Jul 15 10:39:43 UTC 2016


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

Comment (by flixos90):

 Replying to [comment:123 sc0ttkclark]:
 > Working on my first pass for WP_Curie -- here's a Gist of what I came up
 with after chatting with @MikeSchinkel:
 >
 > https://gist.github.com/sc0ttkclark/1264c66297190548d138e785e39ab3d6
 >
 > Still need to review it and make sure it's doing what we want/need it to
 do. But right now, it can parse a string and do what it needs to do. Open
 to feedback!

 I thought it might be useful for this class to be flexible to support
 other use-cases than "type" and "subtype" for the future, so I worked on
 such an approach, based on your class:

 https://gist.github.com/felixarntz/a678b7913e268111fda0666824fe4b31

 This allows to set flexible keys (here it's "type" and "subtype"), for
 example in a derivated class. We could also go a little further and make
 the class and the `set_keys()` method abstract, and then we would
 introduce another class named something like `WP_Object_Type_Curie` that
 implements that method.

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


More information about the wp-trac mailing list