WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#38920 new enhancement

Use REST API for link query in editor

Reported by: iseulde Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: rest-api Cc:
PR Number:

Description

This doesn't necessarily show best practices or whatever, it's just replacing and admin ajax endpoint with a REST API one and not a big change.

Reviewing the implementation of this is a good place to start, e.g. handling date formatting.

Patch still needs date formatting and query other post types.

Attachments (1)

38920.patch (2.3 KB) - added by iseuldebot 3 years ago.

Download all attachments as: .zip

Change History (10)

@iseuldebot
3 years ago

#1 @rachelbaker
3 years ago

Love this! Thanks @iseuldebot

#2 @iseulde
3 years ago

One of the things I run into with this: there seems to be no way to query all post types as once (or a set) like you can do with WP_Query. So you have to start making multiple requests which is a bit insane.

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


3 years ago

#4 @afercia
3 years ago

I'm totally new to the REST API so I may be wrong, but maybe one thing to consider when using the API in core is that it returns by default all the post fields including the content. With very long posts the response could be huge, while here we need just the ID, title, permalink, and date (the "info").

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


3 years ago

#6 @afercia
3 years ago

Re: date formatting see #39222 and #38342.

#7 @afercia
3 years ago

  • Focuses rest-api added

This ticket was mentioned in Slack in #core-js by afercia. View the logs.


2 years ago

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


2 years ago

Note: See TracTickets for help on using tickets.