[wp-trac] [WordPress Trac] #48819: Filter response by context misses certain schemas
WordPress Trac
noreply at wordpress.org
Thu Nov 28 23:42:50 UTC 2019
#48819: Filter response by context misses certain schemas
--------------------------------------+--------------------------------
Reporter: TimothyBlynJacobs | Owner: TimothyBlynJacobs
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.4
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+--------------------------------
Changes (by TimothyBlynJacobs):
* keywords: => has-patch has-unit-tests
Comment:
I did a first pass patch implementing the changes described above. I ended
up extracting it to a standalone function. I think it is still helpful
when not subclassing `WP_REST_Controller`. It also made it a bit easier to
test.
This new function also uses recursion to ensure we traverse the whole
schema. It seemed like it might be unsafe BC wise to implement recursion
with the original method if any controllers are overwriting that method
and calling the parent.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48819#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list