[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
Tue Feb 11 16:27:10 UTC 2020
#47779: Add a filter to `get_item_schema()` to be able to extend the schema of
existing properties
-------------------------------------------------+-------------------------
Reporter: luisherranz | Owner: kadamwhite
Type: enhancement | Status: closed
Priority: normal | Milestone: 5.4
Component: REST API | Version: 4.7
Severity: trivial | Resolution: fixed
Keywords: has-patch dev-feedback has-unit- | Focuses: rest-api
tests needs-refresh |
-------------------------------------------------+-------------------------
Changes (by kadamwhite):
* status: accepted => closed
* resolution: => fixed
Comment:
In [changeset:"47265" 47265]:
{{{
#!CommitTicketReference repository="" revision="47265"
REST API: Introduce rest_{$this->post_type}_item_schema filter to enable
manipulation of schema values.
register_rest_field can be used to add properties to a schema, but no
mechanism existed to alter existing properties like "content".
Running the schema through this filter lets plugins append additional sub-
properties to existing schema definitions.
Props luisherranz, TimothyBlynJacobs, swissspidy, westonruter, kadamwhite.
Fixes #47779.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47779#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list