[wp-trac] [WordPress Trac] #47779: Add a filter to `get_item_schema()` to be able to extend the schema of existing properties

WordPress Trac noreply at wordpress.org
Thu Aug 1 18:30:00 UTC 2019


#47779: Add a filter to `get_item_schema()` to be able to extend the schema of
existing properties
-------------------------+------------------------------
 Reporter:  luisherranz  |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  REST API     |     Version:
 Severity:  trivial      |  Resolution:
 Keywords:               |     Focuses:  rest-api
-------------------------+------------------------------

Comment (by TimothyBlynJacobs):

 I think we should consider not allowing people to add properties to the
 main object via this filter and enforce people to use the additional
 fields API for that case.

 Something like comparing the keys of `$schema['properties']` before and
 after the filter call and issuing a `_doing_it_wrong`.

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


More information about the wp-trac mailing list