How can I change block editors suggested links to display another url (i.e. from api.mysite to www.mysite)

Question

This is potentially not a straightforward question in that its not a native WP installation. I use a JavaScript framework (Vue/Nuxt) on the frontend at www.mysite and WordPress is running from a subdomain at api.mysite, the theme presents the relevant page in an iframe for the WordPress admin so it feels the same as a normal WordPress site.

The client does all editing from the api subdomain but it isn’t very intuitive for them when adding links as all the suggested links will show up with the current subdomain URL, in this case api.mysite.com/contact. This is confusing as when viewing the site they see www.mysite.com/contact. How can I alter both the page search list results to filter/swap out api for www whilst retaining the site url/domain in the wordpress settings so uploads are still functional? Is there a filter or something that I am missing?

This can be purely visual for editors only, it can still store it in the db as api.mysite if it cannot be done another way as I currently perform the swap in Nuxt before rendering anyway.

0
Nexus1234 4 months 0 Answers 14 views 0

Leave an answer