0
votes
2answers
58 views

jQuery Autocomplete not working with wp_localize_script

Bit of background: I am building an autocompleting-search box for a list of Trades (a Custom Taxonomy). I asked this question and very helpfully got a much better understanding of how WordPress and ...
0
votes
0answers
49 views

wp_localize_script seems to break with W3TC combine/minify [on hold]

I am using a simple plugin Simple Subscriber Signup Widget (which I made) which just allows users to submit their email address to the subscribers list. It does this via an ajax call which uses ...
0
votes
2answers
144 views

WP_LOCALIZE_SCRIPT doesn't work

I am creating AJAX loading and need to use WP_LOCALIZE_SCRIPT but cannot make it work. Here is my code. I place it in functions.php wp_enqueue_script( 'page_data'); $gallery_js_data_array = array( ...
0
votes
1answer
162 views

wp_localize_script not create variable in head section

I try to make an ajax function in wordpress and I enqueued my script and declared my variables like this in functions.php: function my_enqueue_scripts() { wp_enqueue_script( 'load_post', ...
0
votes
1answer
71 views

How to load dynamic option with ajax

Basically I'm creating an options page in which the user will click on a button to display a text input field, which will then be populated by the user with a name. This name will be then saved into ...
0
votes
1answer
196 views

Can't seem to get wp_localize_script to work

This is my code: wp_enqueue_script('ms_ajax_localized'); wp_localize_script( 'ms_ajax_localized', 'MS_Ajax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'nextNonce' => ...
1
vote
1answer
817 views

How to localize inline script called with ajax

I have a loop of posts and I allow a user to edit each post using ajax. When the edit button is clicked for the post I use ajax to retrieve the template part containing the edit form for the post. ...
0
votes
1answer
171 views

Parsing post->ID in included plugin file

running into something that has got me completely puzzled. I have a plugin with a main file that looks like this: // Global Variables $mouldings_prefix = 'mouldings_'; $mouldings_name = 'Mouldings'; ...
-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( ...
1
vote
1answer
187 views

How to localize admin.php only once

I am creating a set of plugins that all use AJAX. Now localizing the admin.php in all the plugins seems to be a bit of an overkill. Is there a way to localize the script only once.\ Now I do not know ...
0
votes
1answer
631 views

Does wp_localize_script Call a Javascript Function or Simply Pass PHP Parameters to It

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 ...
2
votes
3answers
468 views

wp_localize_script $handle

Can anyone tell me what the "$handle" ( first parameter ) of wp_localize_script is normally used for. Thanks. P.s.: I have no idea why but stackexchange is telling me this question dosen't meet ...