Ticket #11520: 11520.wrapper.2.patch
File 11520.wrapper.2.patch, 1.7 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 * Originally used to localizes a script. 70 * See http://core.trac.wordpress.org/ticket/11520 for more information. 71 * 72 * @since r16 73 * @see wp_add_script_data() 74 */ 75 function wp_localize_script( $handle, $object_name, $l10n ) { 76 return wp_add_script_data( $handle, $object_name, $l10n ); 77 } 78 79 /** 67 80 * Adds extra Javascript data. 68 81 * 69 82 * Works only if the script has already been added. … … 78 91 * the object would contain all values. In that case if two or more keys are the same, 79 92 * the last value overwrites the previous. The function is named "localize_script" because of historical reasons. 80 93 * 81 * @since r1694 * @since 3.3 82 95 * @see WP_Scripts::add_script_data() 83 96 */ 84 function wp_ localize_script( $handle, $name, $data ) {97 function wp_add_script_data( $handle, $name, $data ) { 85 98 global $wp_scripts; 86 99 if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) { 87 100 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.')