Add get_option to jquery
I have created a settings page that contains various radio button options for a custom plugin.
A radio button I've created is to 'display dots' with the values yes or no. I can get use the value any other time except in the jQuery function below.
I would like to get the value of the option to use for 'dots' in the jQuery function below.
jQuery script
script type="text/javascript"
jQuery(document).ready(function(){
jQuery('.single-item').slick({
arrows: true,
dots: ***OPTION VALUE HERE (true or false)***
});
});
To display the radio buttons I'm using:
input type="radio" name="testimonial_bullet" id="mws_testimonial_bullet_yes" value="" checked="checked"Yes
input type="radio" name="testimonial_bullet" id="mws_testimonial_bullet_no" value="no" ?php if (checked( get_option('testimonial_bullet'), 'no' )); ? /No
To get the get_option value, I'm using:
if (get_option('testimonial_bullet') == 'no') {
// code here
}
Any help much appreciated