I'm creating a plugin that uses jQuery to modify some css, but what I can't figure out is how you can control the execution of the jQuery with WordPress plugin options (like checkboxes true/false). Can WordPress options be used as "variables" in jQuery? Or would every case require a unique .js file?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
Variable can be passed to jQuery or any javascript using Example:
How to get the variables in your javascript:
WordPress will output your variables between See wp_localize_script from Otto on WordPress for more information. Edit:Try adding the variables to a function that returns the value. I'm using the exact code below and it works.
The function that returns the variables below:
|
|||||||||||
|