Try this:
$options = get_option( 'theme' );
wp_localize_script( 'flexslider', 'flex_vars', array (
'flex_auto' => ($options['slide-auto']) ? 'true' : 'false',
'flex_animation' => $options['slide-animation'],
'flex_direction' => $options['slide-direction']
) );
Assuming slide-auto
is the option you made a boolean.
This script isn’t tested, I directly typed it in here.
Related Posts:
- Creating Multiple wp_localize_script for Shortcode?
- Click link on plugin/theme page and open the contextual help on a specific tab
- Localize variable for multiple Shortcodes
- Using jQuery to retrieve customizer value
- WordPress Ajax problem with undefined url
- Validating a cloned/repeatable input (jQuery) [closed]
- Set TRUE or FALSE based on a wp_localize_script option value
- Problem passing id-specific objects to javascript via wp_localize_script
- Getting jQuery AJAX to work in WordPress (getting -1)
- wp_enqueue_script calling jQuery at different times for different browsers?
- Get with jQuery the value of an ACF field
- bundled jquery in theme js not working with wp_localize_script
- Passing variable data from external jQuery file to options.php
- jQuery dialog prints HTML-Tags under WordPress
- Using WP Ajax and jQuery to process multiple forms on the same page?
- My javascript is returning this error: $.ajax is not a function
- Bootstrap – Uncaught TypeError: Cannot read property ‘fn’ of undefined
- Invalid or unexpected token on a very simple function
- javascript function wait until another function to finish
- How to get a cross-origin resource sharing (CORS) post request working
- Adding a page loader using jQuery
- jquery – return value using ajax result on success
- onclick event pass
- id or value
- Can you detect “dragging” in jQuery?
- Twitter Bootstrap Modal Form Submit
- ajax stopped working when not logged in?
- Is there a way to enable Cross-Origin Resource Sharing for WordPress’ ajaxurl?
- Making $ globally accessible with jQuery.noConflict()
- Color Picker (iris) in widget – refresh when edited in Customizer
- Ajax call does not activate callback function
- Add `datetimepicker` to form
- wp_enqueue_script won’t load in header?
- Hide pages from google and visitors
- How wp_enqueue_script works?
- Can’t move jQuery to footer
- Get specific image size for small viewport width
- wp_enqueue_scripts hook is not being called
- wp_ajax unauthenticated and authenticated
- WordPress ajax function parameter value not being passed
- Is it safe to include a javascript file in a template’s php file?
- Firebug : Problem with jQuery in WordPress admin panel
- JSON output returns page source code [closed]
- Display data on same page as form without refresh
- Masonry and Jetpack Infinite Scroll – overlap issue
- Dealing with a library that depends on jQuery
- How can I load jquery library into my dashboard widget?
- Accessing user Meta data via REST and backbone
- Gravity Forms – jQuery in List Field [closed]
- Help with a jQuery Carousel
- Retrieve post info within AJAX helper function
- Dropdown filtering extremely slow
- Fall Back Google CDN in JavaScript
- wp_enqueue doesn’t work
- filterable portfolio with wordpress and jquery
- Gutenberg – Title field required
- Trouble enqueueing jquery with custom theme
- WP-admin redirects to login after adding SSL certificate
- Dynamicaly update field created with wp_editor()
- superfish.js seems it is not working properly after wordpress upgarde to 4.6.1
- add custom HTML css with js doesn’t work
- Change quantity via jQuery and disabile quantity field [closed]
- Get value of selected option in select field in a WordPress form
- How to retrieve WP_Object that is inside an array of another array
- jQuery – Toggle megamenu submenu items by click
- General Settings: display custom plugin field after Site Address field
- WP Customizer: Save a control state
- WordPress Insert not working with ajax
- WP AJAX API with JS file
- need to override function in jquery.ui.datepicker.js
- Dynamic WordPress editor in meta box
- How to modify iFrame content in an admin thickbox
- How to wrap posts into divs?
- jQuery Drill Down iPod Menu FOUC and Selecting Current page
- Absolute path to stylesheet_dir/images/my_img.jpg does not work?
- Which hook to use when adding ajax to viewer-facing side?
- jquery.min has very long TTFB
- animate.style on wp-login.php
- Form validation before submitting
- Special Characters and Spaces are not transferred correctly via AJAX call.
- How to manipulate elements on the Insert Media Attachment settings popup
- How to toggle custom WP archive list
- I can’t enqueue Suggest.js in frontend – not added
- Jquery code won’t run loaded from WP, but run from console
- JQuery is not defined but jquery script is loaded in source [closed]
- owl carousel not working after ajax load [duplicate]
- jQuery post method in admin menu
- jquery not working correctly in plugin options page?
- jQuery AJAX add json2 dependency?
- Running javascript in a child theme. Works in jsfiddle
- How to block action if post is “dirty”?
- $ not defined using jQuery in WordPress
- How to read the contents of single post through RSS feed
- jQuery Ajax / Modal admin event not firing since 3.6. Seems to not recognize “a” tag
- Auto Select Child categories on Multiple Dropdown – Jquery
- WordPress video end function [duplicate]
- jQuery Live Form Validation in WordPress
- bootstrap-slider.js by seiyria not working in wordpress
- Sliders with buttons [closed]
- Generate dynamic ID’s for each accordion button
- Impossible to update jQuery version from 3.1.0