Created
January 14, 2020 19:52
-
-
Save mcorkum/cb16743e6b736cc7d55c29792ce4af83 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp_register_script('name', 'path/to/script.js'); | |
$array = array( | |
'poop' => 'yes, please', | |
'pee' => 'would prefer poop' | |
); | |
wp_localize_script('name', 'js_object_name', $array); | |
wp_enqueue_script('name'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment