We are currently trying to share a flyout menu across all of our sites, and so we have an endpoint set up on the main site which serves the html of the flyout menu. On our blog, we need to cache that html every x amount of time, replace it with default content if the feed on the main site is down, and then serve it up on a custom endpoint on wordpress, so that the same javascript that works on all our other sites will work on the blog and we only have to maintain one menu js file.

I would like to store this as a transient or maybe even avoid touching the wp db altogether with it, but the requirement for the endpoint on the blog’s domain means that I either need to be able to just dump the transient when you hit the endpoint URL, or I need to be able to display a page when you hit that URL that only has some javascript on it to try to AJAX in the flyout and, if necessary, replace it with default content.

How do I display transients as if they were pages, or display a “page” at an endpoint that is just a snipped of html from a plugin, and not a real page in the wordpress db?

Read more here: WordPress Custom Menu Loaded From External Site


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: