gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

UrlInput component only suggests posts, not pages.

Open thatdevgirl opened this issue 8 years ago • 3 comments

Issue Overview

The UrlInput component only suggests posts, not pages, when a user starts to enter text. In the code in /blocks/url-input/index.js, only /wp/v2/posts is being queried. I believe that /wp/v2/pages should be queried as well.

Steps to Reproduce

I first noticed this issue in the Button block, but this issue exists in any block that uses the UrlInput component.

  1. Create a new post/page and add the Button block.
  2. Start typing in the title of a page. Note that you will not see a suggestion for that page or any other page.
  3. Start typing in the title of a post. Note that you do see suggestions for that posts and other posts.

Expected Behavior

The UrlInput field should suggest posts of all post types (posts and pages).

thatdevgirl avatar Apr 25 '18 15:04 thatdevgirl

I’d go as far as saying it should also include custom post types which are set to public.

paulwilde avatar Apr 25 '18 16:04 paulwilde

I've used a copy of that component that accepts a prop for the post type to check and changes the API endpoint accordingly.

The only way to do this is if multiple endpoints are checked in parallel or a search endpoint is added to the core API. You could add a custom one for that in the meantime to your project.

roborourke avatar Apr 26 '18 11:04 roborourke

This will be addressed with #2084

danielbachhuber avatar May 01 '18 14:05 danielbachhuber