Easy question: I'm trying to understand wp_localize_script.
Does wp_localize_script call a javascript function or does it simply pass PHP parameters to javascript?
I want to pass php parameters to a javascript function and call the js function.
Easy question: I'm trying to understand wp_localize_script. Does wp_localize_script call a javascript function or does it simply pass PHP parameters to javascript? I want to pass php parameters to a javascript function and call the js function. |
||||
|
An Example Your theme needs to take a piece of post meta data and make it accessible to a javascript function. So you'd hook into
Then somewhere the enqueued
Make sense? |
|||