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!
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?
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.
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?
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.
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.
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.
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.
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.
My issue is resolved now. Thank you!