Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#38343 closed enhancement (maybelater)

Press This: Leverage REST API endpoints

Reported by: adamsilverstein's profile 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:

https://cl.ly/0u1F2Y1z2e0r/Press_This_2016-10-18_09-57-10.jpg

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)

38343.diff (6.1 KB) - added by adamsilverstein 8 years ago.
38343.2.diff (9.1 KB) - added by adamsilverstein 8 years ago.

Download all attachments as: .zip

Change History (15)

This ticket was mentioned in Slack in #core-restapi by adamsilverstein. View the logs.


8 years ago

#2 @kraftbj
8 years ago

  • Component changed from General to Press This

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

#5 @adamsilverstein
8 years ago

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!

This ticket was mentioned in Slack in #core by adamsilverstein. View the logs.


8 years ago

#7 @adamsilverstein
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 @adamsilverstein
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

#12 @afercia
8 years ago

  • Focuses rest-api added

#13 @kraftbj
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

Note: See TracTickets for help on using tickets.