Plugin Author
Joe
(@morehawes)
Hi @collabora,
Thanks for your suggestion, I think this could be a nice addition.
Please note that I have added some new settings (Waymark Settings > Maps > Interaction) to help with this problem.
Cheers,
Joe
Plugin Author
Joe
(@morehawes)
Hi @collabora,
I just wanted to let you know that I put together an example of how to achieve this using the Waymark callback function (you will need to add a JavaScript function to your site).
I hope this helps.
Cheers,
Joe
Thread Starter
Dean
(@collabora)
Hi Joe,
Thanks, but that’s above my pay grade. 🙁
Joe, thanks, that’s very useful! The only thing is: I know how to add PHP functions to the functions.php file, I’ve done it already.
As for Javascript functions, Google tells me that I must do it like this:
function ti_custom_javascript() {
?>
<script>
// your javascript code goes here
</script>
<?php
}
add_action('wp_head', 'ti_custom_javascript');
Is it enough I litterally copy & paste your JS function over there, with no further editing?
THX
Bye!
A.-
Plugin Author
Joe
(@morehawes)
Hi @mistermagoo8691,
Yes that’s a valid way to add JavaScript to your site.
Note that using this method the JavaScript function will be added to every page. Not really an issue, as the callback function is only executed if the Waymark Shortcode is being displayed and that function name is provided using loaded_callback.
I hope this helps.
Cheers,
Joe
Thanks Joe!
Since I have > 50 pages with at least 1 waymark map each, and I’d need to edit them all one by one, adding the “loaded_callback=”waymark_refresh” in the shortcode, do you think you’ll ever add it as a “global parameter” (=if TRUE, all maps have the reset button) to the plugin configuration? If yes, I think I’ll wait for it 🙂