Skip Navigation

[Resolved] Can’t find links from other post types when using Block Editor

This thread is resolved. Here is a description of the problem and solution.

Problem: I am using the Block Editor and trying to create a link to a custom post type. I highlight the desired text and click the link icon, but then I cannot find the post when I search for that post title.

Solution: Be sure the custom post type options include "show_in_rest" or you will not be able to find those posts in the Block Editor's autosuggest fields.

This support ticket is created 3 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 9 replies, has 2 voices.

Last updated by michaelS-53 3 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#1660843

We're using the Block Editor in our default post type (we call it "Articles") and when I make a link and try to search existing posts and pages, it only returns results from either our Envira gallery type, or within our default post type itself. It won't return things from our Games or Reviews post types.

Oddly, Classic editor works just fine, so I'm wondering if there's something that's getting glitched? Would love to know if there's a fix. Thanks!

#1662379

Hi, can you tell me more about how you are trying to add a link? Are you selecting text in the paragraph block and clicking the link icon above the text editor, or choosing a specific block to insert? I just tested by selecting text in a paragraph block and searching for another custom post type, and it seems to be working correctly. Am I misunderstanding?

#1662381

Hi Christian,

So the thing I'm trying to do is, let's say I'm writing an article on Final Fantasy, I want to be able to highlight link text and search for Final Fantasy and have it return all the results, such as the Review of the game.

Currently it doesn't seem to return anything across post types.

#1663575

You should be able to search by post title across any post types. I'm not clear from your comment if you're searching for post titles, or if you're searching by topic like "Final Fantasy", when the other post type titles are not "Final Fantasy". Which are you trying to search for - post titles, or some other content?

#1664079

Ideally both would be searchable. I can definitely get results within the post type (e.g: Articles show other Articles), but I can't seem to find things across types, either by what's in the title or in the post body.

As such, when I write something in the Articles post type and try to link a Review, I can't get it to return items from Reviews for some reason, regardless of search terms.

#1664089

Okay the problem you're describing when searching for a Review by title within an Article post isn't normal, so I'd like to investigate that in more detail. If you'd like I can log in to your wp-admin area and take a closer look. Please provide login credentials in the private reply fields here and let me know which Article I can use for testing, and which Review I should try to create a link for. I'll check some configurations, run a quick test and let you know what I can figure out.

#1667461
link-step-2.png
link-step-1.png

Well it works exactly like I expected in my test, so I'm not sure I understand the problem. My objective was to create a link to the Wintermoor Tactics Club Review, a published post from another custom post type:
hidden link

I edited the test post, highlighted the text "bit more oomph" in the main post body area, and clicked the link icon (see link-step-1.png), and an input field appeared where I was able to search for another post by title. I typed "Wintermoor" and two options appeared - one Game and one Review (see link-step-2-.png). I clicked the Review title, clicked "Accept", and a link was created successfully. Then I updated the test Article post and checked it on the front-end of the site. You can see the link works as expected. If I click it, I'm redirected to the Wintermoor Tactics Club Review post:
hidden link

What am I missing? Is there a specific post title you cannot find in the suggestions field? Please provide specific details and I can check.

#1667483

Hi Christian,

Sorry, I forgot to include: This only occurs when using the block editor. The classic editor works fine, but we want our writers to use the block editor. That's where it seems to go wonky.

#1668725

Okay thanks, I see the problem now. I had to do some research to find out why this is happening, and I learned something new! It turns out each custom post type must be exposed in the REST API if you want it to appear in the autosuggest results. For testing, I exposed the Review post type to the REST API and I can see results from the Review post type appear now in the autosuggest field. You can try exposing other custom post types to the REST API if you'd like to see how this works. Go to Toolset > Post types and edit the post type of your choice. Scroll down and open the "Options" panel, and you will see an option "show_in_rest" you can activate to expose the post type in the REST API.

#1668745

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.