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

WordPress Trac noreply at wordpress.org
Mon Feb 6 18:42:33 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:
-------------------------------------------------+-------------------------

Comment (by kadamwhite):

 > To mitigate both of those, it would be nice to be able to explicitly
 whitelist meta keys for a given object subtype. Either a filter on eg
 `get_registered_fields()` or add it maybe like
 `add_post_type_support('cpt', 'custom-fields', array('key', 'key1',
 'key2')` or when the post type is registered.

 I sympathize with this. However, I feel like I would expect
 `unregister_meta` to unregister all meta for a key, whether the less-
 specific value was shadowed or not.

 After working a little bit more with meta within the REST API, the
 capability to restrict a registered meta value to a specific type of
 resource feels pretty critical if meta is to be used within the API. I'd
 love to talk through this one in slack this week.

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


More information about the wp-trac mailing list