What about Deferring a localized script?

The solution is basically from this SO post: When wordpress “localizes” a script, what it does is has php print out <script></script> tags with javascript objects in them that are then accessible within the DOM to the scripts you are “sending” the parameters to. If I understand correctly, the extension of WP_Scripts simple adds a … Read more

bundled jquery in theme js not working with wp_localize_script

You can’t use wp_localize_script with jquery. this function use the WP_Scripts::localize() function which have a condition right in the start. You can see it in the file \wp-includes\class.wp-scripts.php line 414 if ( $handle === ‘jquery’ ) $handle=”jquery-core”; You can do something else like add the script with other action like wp_head if your script is … Read more