Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link modal suggestions only include posts when they should also include pages and CPTs #2084

Closed
afercia opened this issue Jul 29, 2017 · 5 comments
Assignees
Labels
Core REST API Task Task for Core REST API efforts [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@afercia
Copy link
Contributor

afercia commented Jul 29, 2017

The link modal links suggestions implemented in #1985 currently searches just for posts.

screen shot 2017-07-24 at 13 58 25

Instead, the current implementation in WordPress searches also for pages and Custom Post Types (any public post):

screen shot 2017-07-29 at 17 39 06

As mentioned in #1985, this is a limitation of the REST API. See the related Trac ticket: https://core.trac.wordpress.org/ticket/39965. Regardless of the reason why, right now there's no feature parity with the current WordPress implementation.

There are also performance concerns, since by default the REST API returns all the post fields including the post content. The response can be huge in size, even several hundreds KB or more than 1MB with very long posts. See related considerations on:
https://core.trac.wordpress.org/ticket/38920
https://core.trac.wordpress.org/ticket/38922
and especially:
"REST API: Provide interface to include or exclude specific fields from response JSON"
https://core.trac.wordpress.org/ticket/38131

@afercia afercia added the Core REST API Task Task for Core REST API efforts label Jul 29, 2017
@mtias mtias added the [Type] Task Issues or PRs that have been broken down into an individual action to take label Aug 2, 2017
@mtias mtias added this to the Beta 0.8.0 milestone Aug 2, 2017
@westonruter
Copy link
Member

There are also performance concerns, since by default the REST API returns all the post fields including the post content. The response can be huge in size, even several hundreds KB or more than 1MB with very long posts.

For this, do note that you can make the request with ?context=embed and the content field will be excluded. That would be a good short term fix.

@mtias mtias modified the milestones: Beta 0.9.0, Beta 0.8.0 Aug 10, 2017
@mtias mtias modified the milestones: 0.10.0, Beta 0.9.0 Aug 18, 2017
@karmatosed karmatosed modified the milestones: 0.11.0, 0.10.0 Aug 25, 2017
@mtias mtias modified the milestones: Beta 1.2, Beta 1.1, Needs API Sep 4, 2017
@afercia
Copy link
Contributor Author

afercia commented Jan 11, 2018

I'd suggest to milestone https://core.trac.wordpress.org/ticket/39965 (add search endpoint) for 5.0.

@karmatosed karmatosed modified the milestones: Needs API, Merge Proposal Jan 25, 2018
@mtias mtias modified the milestones: Merge Proposal, Core API Mar 8, 2018
@jeffpaul
Copy link
Member

This ticket was mentioned in Slack in #core-editor by jeffpaul. View the logs.

@danielbachhuber danielbachhuber changed the title The link modal links suggestions searches just for posts Link modal suggestions only include posts when they should also include pages Apr 23, 2018
@braders
Copy link

braders commented Apr 24, 2018

In the current editor it is also possible to inject non-WordPress resources with the wp_link_query filter (For example allow selection of archive pages). It would be great if this functionality (or similar) was supported by the new editor.

@danielbachhuber
Copy link
Member

@felixarntz is going to do a first pass on this against Gutenberg over the next week.

@afercia afercia changed the title Link modal suggestions only include posts when they should also include pages Link modal suggestions only include posts when they should also include pages and CPTs May 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core REST API Task Task for Core REST API efforts [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

8 participants