Migrate from the custom O2 API to Core's `wp.api` client.
- Dominant language
- JavaScript
- Stars
- 338
- Forks
- 56
- Avg merge
- 24m
- Merged PRs (30d)
- 16
Description
When O2 was written, Core's Rest API wasn't a thing, so we needed our own api endpoints and method for querying them.
With the WP Rest API mature and in core, with a very stable Backbone-powered client in core, it would make more sense to use the existing infrastructure, rather than reinventing the wheel. This could be swapped out bit-by-bit and need not be done all at once.
Documentation: https://developer.wordpress.org/rest-api/using-the-rest-api/backbone-javascript-client/
An example of how to publish a post:
```js
const newPost = new wp.api.models.Post( {
content: 'i am a new post',
status: 'publish'
} );
newPost.save();
```
and then newPost has details of the post.
Contributor guide
No contributing guide indexed for this repository
Research direction
No files or tests are named. Read the linked Backbone JavaScript client documentation, then inventory O2's custom API endpoints and query method and choose one operation as a migration pilot. Done means that operation uses Core's wp.api client while still providing the post details shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100