Converts content loads to new API endpoints#170
Merged
matt-bernhardt merged 1 commit intoprodfrom Jan 23, 2017
Merged
Conversation
1e16039 to
bf58fb0
Compare
f0d2637 to
b7511c4
Compare
8450416 to
aa40dc7
Compare
3dd2f9e to
8dd932d
Compare
0fcc762 to
9b5cb9b
Compare
5db9130 to
7c86d38
Compare
This was referenced Jan 23, 2017
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
With the move to Wordpress 4.7, the API used by this theme for Experts and Alerts will change its structure:
Alerts, which are currently loaded at
/wp-json/postswill move to/wp-json/wp/v2/postsExperts, which are currently loaded at
/wp-json/posts?type=expertswill instead be found at/wp-json/wp/v2/experts?per_page=99In order to make this transition as smooth as possible, this PR modifies the theme to harvest both endpoints if necessary. The old URL is queried first, and then if that fails the new URL is queried.
Additionally, the code is put in place to augment the API under both conditions. We look for custom fields in both cases, and the process of adding custom fields to the API is different under the new and old codebases.
After we upgrade to 4.7 and things are stable, a further branch will remove the old mechanisms.