WordPress.org

Make WordPress Core

Opened 12 months ago

Last modified 4 months 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:

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 12 months ago.

Download all attachments as: .zip

Change History (10)

@iseuldebot
12 months ago

#1 @rachelbaker
12 months ago

Love this! Thanks @iseuldebot

#2 @iseulde
12 months 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.


12 months ago

#4 @afercia
12 months 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.


12 months ago

#6 @afercia
12 months ago

Re: date formatting see #39222 and #38342.

#7 @afercia
10 months ago

  • Focuses rest-api added

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


5 months ago

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


4 months ago

Note: See TracTickets for help on using tickets.