Changes between Initial Version and Version 1 of Ticket #25280, comment 16
- Timestamp:
- 05/07/2014 05:47:03 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #25280, comment 16
initial v1 2 2 3 3 I added the following code to my template: 4 ``` 5 wp_enqueue_script( 'localize_test', get_template_directory_uri() . '/localize_script.js', array(), '1.0.0', true ); 4 {{{ 5 wp_enqueue_script( 'localize_test', get_template_directory_uri() . '/localize_script.js', array(), '1.0.0', true ); 6 6 $array_to_localize = array( 7 7 'a_string' => __( 'Some String' ), … … 10 10 'f_boolean' => false, 11 11 ); 12 wp_localize_script( 'localize_test', 'localized_variable', $array_to_localize ); 13 }}} 12 14 13 wp_localize_script( 'localize_test', 'localized_variable', $array_to_localize ); 14 ``` 15 16 the created a localize_script.js file with the single line ```console.log( localized_variable );``` 15 the created a localize_script.js file with the single line {{{console.log( localized_variable );}}} 17 16 18 17 result was as expected: