Ticket #11520: 11520.wrapper.patch
File 11520.wrapper.patch, 1.6 KB (added by , 13 years ago) |
---|
-
wp-includes/functions.wp-scripts.php
64 64 } 65 65 66 66 /** 67 * Wrapper for wp_add_script_data() 68 * 69 * @since r16 70 * @see wp_add_script_data() 71 */ 72 function wp_localize_script( $handle, $name, $data ) { 73 return wp_add_script_data( $handle, $name, $data ); 74 } 75 76 /** 67 77 * Adds extra Javascript data. 68 78 * 69 79 * Works only if the script has already been added. … … 78 88 * the object would contain all values. In that case if two or more keys are the same, 79 89 * the last value overwrites the previous. The function is named "localize_script" because of historical reasons. 80 90 * 81 * @since r1691 * @since 3.3 82 92 * @see WP_Scripts::add_script_data() 83 93 */ 84 function wp_ localize_script( $handle, $name, $data ) {94 function wp_add_script_data( $handle, $name, $data ) { 85 95 global $wp_scripts; 86 96 if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) { 87 97 if ( ! did_action( 'init' ) ) -
wp-includes/script-loader.php
498 498 */ 499 499 function wp_just_in_time_script_localization() { 500 500 501 wp_ localize_script( 'autosave', 'autosaveL10n', array(501 wp_add_script_data( 'autosave', 'autosaveL10n', array( 502 502 'autosaveInterval' => AUTOSAVE_INTERVAL, 503 503 'savingText' => __('Saving Draft…'), 504 504 'saveAlert' => __('The changes you made will be lost if you navigate away from this page.')