Opened 8 years ago
Closed 7 years ago
#38343 closed enhancement (maybelater)
Press This: Leverage REST API endpoints
Reported by: | adamsilverstein | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Press This | Keywords: | |
Focuses: | javascript, rest-api | Cc: |
Description
If the REST API content endpoints were in core, how would we rebuild core features (like Press This) to use it? I am opening this ticket to track work on converting the Press This feature to using the REST API.
Press This is a compact JavaScript App available under tools that can be launched from the Dashboard, or from a browser's bookmarks/bookmark bar:
Press This communicates with WordPress via custom wp-ajax endpoints as well as by submitting form data directly to post.php
via ajax mirroring what the wp post editor does. The goal here would be to switch all server interactions over to using the REST API:
- Saving posts in
submitPost
, include handling to redirect the user (to the login page) similar to current code - Creating new categories in
saveNewCategory
I've started work on this locally and will post a POC soon!
Attachments (2)
Change History (15)
This ticket was mentioned in Slack in #core-restapi by adamsilverstein. View the logs.
8 years ago
This ticket was mentioned in Slack in #core-pressthis by kraft. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by krogsgard. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by adamsilverstein. View the logs.
8 years ago
#7
@
8 years ago
38343.diff covers submitPost
post data and redirects. Working on categories/tags as part of save next as well as saveNewCategory
.
This ticket was mentioned in Slack in #core-restapi by rachelbaker. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by pento. View the logs.
8 years ago
#10
@
8 years ago
38343.2.diff Switch category creation from admin-ajax press-this-add-category
callback to using REST API. Should we remove the legacy ajax handlers?
Development continues in github, its easier to see whats changing by following the commits there: https://github.com/adamsilverstein/wordpress-develop/compare/master...adamsilverstein:ticket-38343
This ticket was mentioned in Slack in #core-restapi by adamsilverstein. View the logs.
8 years ago
#13
@
7 years ago
- Milestone Awaiting Review deleted
- Resolution set to maybelater
- Status changed from new to closed
With Press This being pulled out of Core to be a "canonical plugin" (for lack of a better term), I'm closing this and referring the issue to https://github.com/WordPress/press-this/issues/1
I have started work on a POC in a branch here: https://github.com/adamsilverstein/wordpress-develop/compare/master...adamsilverstein:ticket-38343, trying to match the functionality of the ajax callback.
I added some filters to both prepare and response to match the existing behavior and ensure backwards compatibility. I'm not sure where these filters belong, maybe in a new file?
Feedback and contributions welcome!