This repository has been archived by the owner on Sep 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 654
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rather than running the main query, let's run just before it.
Let's see if this breaks anything. |
For my own edification, what's the advantage we'll glean from this change? |
@kadamwhite faster API requests, and reduced load on your database server. |
@kadamwhite Without this, the main query will always be run (essentially This fixes that, at the expense of moving before some actions/filters might have run, and breaking backwards compatibility. |
pdufour
added a commit
to britco/dynamic-cdn
that referenced
this pull request
Aug 23, 2016
Due to WP-API/WP-API#1270 the "template_redirect" action does not run when a REST-API request is being served. So hook into rest_api_init so WP-API v2 responses can be modified.
pdufour
added a commit
to britco/dynamic-cdn
that referenced
this pull request
Aug 23, 2016
Due to WP-API/WP-API#1270 the "template_redirect" action does not run when a REST-API request is being served. So hook into rest_api_init so WP-API v2 responses can be modified.
pdufour
added a commit
to britco/dynamic-cdn
that referenced
this pull request
Aug 23, 2016
Due to WP-API/WP-API#1270/ the "template_redirect" action does not run when a REST-API request is being served. So hook into rest_api_init so WP-API v2 responses can be modified.
pdufour
added a commit
to britco/dynamic-cdn
that referenced
this pull request
Nov 29, 2016
Due to WP-API/WP-API#1270 the "template_redirect" action does not run when a REST-API request is being served. So hook into rest_api_init so WP-API v2 responses can be modified.
pdufour
added a commit
to britco/dynamic-cdn
that referenced
this pull request
Nov 29, 2016
* Merge * Add support for WP-API v2 Due to WP-API/WP-API#1270 the "template_redirect" action does not run when a REST-API request is being served. So hook into rest_api_init so WP-API v2 responses can be modified. * Add json test case * Remove equal sign in regex - This allows the search and replace to match things like {"blah": "image url"}
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rather than running the main query, let's run just before it.
Fixes #764.