[insert_php] won't execute when used inside Store Locator Plus plugin
-
I’m trying to modify the results of a list of stores, and am editing the template provided by Charleston in their Store Locator Plus plugin. In fact, everything’s working except for one small thing…urlencode() a URL in the template. I’m passing some custom stuff through there, but the links are breaking because part of the concatenated URL are not encoded.
Here’s an example of what I’m trying to achieve:
<span class="slp_result_contact slp_result_website"><a href="/leaving?company=[insert_php]return urlencode('do_shortcode([slp_location name])');[/insert_php]&url=[slp_location url wrap website]">[slp_option label_website ifset url]</a></span>
Been trying to figure out a solution to this for days, and so far no luck. Hopefully there’s a way to run something in functions.php to get the [insert_php] to actually execute. Unfortunately, it doesn’t appear to be. This is what the link looks like when I inspect it in Chrome Inspector:
https://my.site.com/leaving?company=%5Binsert_php%5Dreturn%20urlencode(%27do_shortcode(Some-Company%20&%20Associates)%27);[/insert_php]&url=https://www.somecompany.com/
…although, ideally I’d hope for…
https://my.site.com/leaving?company=Some-Company+&+Associates&url=https://www.somecompany.com/
- The topic ‘[insert_php] won't execute when used inside Store Locator Plus plugin’ is closed to new replies.