How to get, in WP page’s script, a wp enqueued script (in Functions.php)?

You have to make sure your script is registered with wp_register_script before your call to wp_localize_script. So in your functions.php file: add_action(‘init’,’my demo_function’); function my demo_function() { // Register the script wp_register_script( ‘myuserscript’, ‘path/to/myscript.js’ ); // Localize the script with your data $theid=get_current_user_id(); $params = array( ‘userid’ => $theid ); wp_localize_script( ‘myuserscript’, ‘MyUserParams’, $params ); … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)