adding inline script
-
So I have a plugin that gets a bunch of values that I want to pass to my javascript.
I know localize_script will output data but I also want a to write out a function call in it.
For example my plugin gets a value of “apple”. Once it does I want to place this in the footer
<script>
var myVar = ‘apples’;
my_function_call(myVar);
</script>Well not exactly but you get the idea. I just want to print it out, and not enqueue a script file.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘adding inline script’ is closed to new replies.