Can't 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' => wp_create_nonce( 'myajax-next-nonce' )) );
I popped it into my functions.php
Bashing my head against the wall. I’ve used wp_localize_script before and I’m just blind to what is wrong this time.
When I load the page I can’t find the script tag in the source anywhere…
Thanks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Can't get wp_localize_script to work’ is closed to new replies.