Skip to content

Converts content loads to new API endpoints#170

Merged
matt-bernhardt merged 1 commit intoprodfrom
matt/fix/166-api
Jan 23, 2017
Merged

Converts content loads to new API endpoints#170
matt-bernhardt merged 1 commit intoprodfrom
matt/fix/166-api

Conversation

@matt-bernhardt
Copy link
Copy Markdown
Member

@matt-bernhardt matt-bernhardt commented Sep 26, 2016

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/posts will move to /wp-json/wp/v2/posts

Experts, which are currently loaded at /wp-json/posts?type=experts will instead be found at /wp-json/wp/v2/experts?per_page=99

In 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.

@matt-bernhardt matt-bernhardt force-pushed the matt/fix/166-api branch 2 times, most recently from f0d2637 to b7511c4 Compare October 18, 2016 20:55
@matt-bernhardt matt-bernhardt changed the title Converts content loads to new API endpoints [WIP] Converts content loads to new API endpoints Oct 20, 2016
@matt-bernhardt matt-bernhardt changed the title [WIP] Converts content loads to new API endpoints Converts content loads to new API endpoints Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant