Make WordPress Core

Changeset 18490


Ignore:
Timestamp:
07/31/2011 09:11:24 AM (13 years ago)
Author:
azaozz
Message:

Bring back wp_localize_script(), see #11520

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/deprecated.php

    r18464 r18490  
    26172617}
    26182618
    2619 /**
    2620  * Localizes a script.
    2621  *
    2622  * Localizes only if script has already been added.
    2623  *
    2624  * @since r16
    2625  * @deprecated WP 3.3
    2626  * @see wp_add_script_data()
    2627  */
    2628 function wp_localize_script( $handle, $object_name, $l10n ) {
    2629     _deprecated_function( __FUNCTION__, '3.3', 'wp_add_script_data()' );
    2630     return wp_add_script_data( $handle, $object_name, $l10n );
    2631 }
    2632 
  • trunk/wp-includes/functions.wp-scripts.php

    r18480 r18490  
    5757
    5858/**
    59  * Adds extra Javascript.
     59 * Adds extra Javascript data.
    6060 *
    6161 * Works only if the script has already been added.
     
    6969 * The $data array is JSON encoded. If called more than once for the same $handle with the same $name,
    7070 * the object would contain all values. In that case if two or more keys are the same,
    71  * the last value overwrites the previous.
     71 * the last value overwrites the previous. The function is named "localize_script" because of historical reasons.
    7272 *
    73  * @since 3.3
     73 * @since r16
    7474 * @see WP_Scripts::add_script_data()
    7575 */
    76 function wp_add_script_data( $handle, $name, $data ) {
     76function wp_localize_script( $handle, $name, $data ) {
    7777    global $wp_scripts;
    7878    if ( !is_a($wp_scripts, 'WP_Scripts') )
Note: See TracChangeset for help on using the changeset viewer.