Is it possible to do this without Ajax, solely with vanilla JS and PHP?
What I am trying to do is:
- Return the shortcode in PHP (easy)
- Show it on the page (easy)
- Allow users to select a text on the front-end (HTML is easy, but how do I send this as a variable?)
- Change the shortcode variable with the chosen text on the front-end and load it dynamically on the page.
My question is: what options do I have? Is it solely Ajax or can I do this with PHP and JS-only?
function place_function() {
return '[myshortcode place="new york"]';
}