[wp-trac] [WordPress Trac] #34219: Move filters out of `rest_api_default_filters()`
WordPress Trac
noreply at wordpress.org
Mon Oct 12 16:13:51 UTC 2015
#34219: Move filters out of `rest_api_default_filters()`
-------------------------+-----------------------
Reporter: swissspidy | Owner: rmccue
Type: enhancement | Status: assigned
Priority: normal | Milestone: 4.4
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+-----------------------
Comment (by swissspidy):
Replying to [comment:3 SergeyBiryukov]:
> Replying to [comment:2 rmccue]:
> > These filters are only added on an API request, since we don't need
them all the time.
>
> Could we add `if ( defined( 'REST_REQUEST' ) ) { ... }` to `default-
filters.php`?
`REST_REQUEST` is defined in `rest_api_init()`, which is hooked to `init`
and therefore executed ''after'' `default-filters.php`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34219#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list