Localizes a script, but only if script has already been added. Can also be used to include arbitrary Javascript data in a page.

learn more… | top users | synonyms

0
votes
1answer
24 views

localizing variable on front-page.php template fails but succeeds on single page and taxonomy archive

I have the following code in a php include file: function pass_the_var() { $video_embed_code = jkaw_oembed_code(); return array( 'embedCode' => $video_embed_code ); } ...
0
votes
1answer
108 views

Passing widget options to external script

I am trying to pass some widget options to an external script using wp_localize_script. I know how to pass the variables and how to use them within the script, but how do I extract the widget options ...
0
votes
1answer
144 views

jQuery dialog prints HTML-Tags under Wordpress

i need some help. I am using wp_localize_script in my Wordpres_Plugin. Inthe documentready-function i use this Code to bring the Message up: $('#button-setup-league').click(function() { $( "#dialog ...
-1
votes
1answer
1k views

Using WP Ajax and jQuery to process multiple forms on the same page?

I'm using the following to make ajax calls: wp_enqueue_script( 'my-ajax-request', TAF_PLUGIN_URL . 'js/ajaxcf.js', array( 'jquery' ) ); wp_localize_script( 'my-ajax-request', 'MyAjax', array( ...
0
votes
0answers
29 views

Pass list of categories to JS

I'm trying to pass a list of all the categories to my MixItUp settings in my JS file to show all the items on load. But I can't seem to generate a list of the categories and reliably send them over to ...
0
votes
0answers
58 views

wp_localize_script problem for shortcode

I have developed a shortcode with wp_localize_script like the below code wp_enqueue_script( 'twi_carousel_tooltip_main_option_js', plugins_url( '/js/main_tooltip.js' , FILE ) , array( 'jquery') , ...
0
votes
0answers
129 views

Passing a location-dependent array via wp_localize_script within a shortcode

I have created a shortcode that is intended to be inserted into custom field of a music custom post type. The shortcode is coverted into an audio playlist using the jplayer jquery plugin (and it's ...