WordPress.org

Make WordPress Core

Ticket #54044: 54044.diff

File 54044.diff, 1.8 KB (added by audrasjb, 5 months ago)

Docs: Provide a more accurate description for functions wp_localize_script, wp_set_script_translations, wp_script_add_data and wp_style_add_data

  • src/wp-includes/functions.wp-scripts.php

    diff --git a/src/wp-includes/functions.wp-scripts.php b/src/wp-includes/functions.wp-scripts.php
    index abe930758d..82d3685672 100644
    a b function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_f 
    186186/**
    187187 * Localize a script.
    188188 *
    189  * Works only if the script has already been added.
     189 * Works only if the script has already been registered.
    190190 *
    191191 * Accepts an associative array $l10n and creates a JavaScript object:
    192192 *
    function wp_localize_script( $handle, $object_name, $l10n ) { 
    224224/**
    225225 * Sets translated strings for a script.
    226226 *
    227  * Works only if the script has already been added.
     227 * Works only if the script has already been registered.
    228228 *
    229229 * @see WP_Scripts::set_translations()
    230230 * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.
    function wp_script_is( $handle, $list = 'enqueued' ) { 
    402402/**
    403403 * Add metadata to a script.
    404404 *
    405  * Works only if the script has already been added.
     405 * Works only if the script has already been registered.
    406406 *
    407407 * Possible values for $key and $value:
    408408 * 'conditional' string Comments for IE 6, lte IE 7, etc.
  • src/wp-includes/functions.wp-styles.php

    diff --git a/src/wp-includes/functions.wp-styles.php b/src/wp-includes/functions.wp-styles.php
    index e1749477ca..d82bb55925 100644
    a b function wp_style_is( $handle, $list = 'enqueued' ) { 
    217217/**
    218218 * Add metadata to a CSS stylesheet.
    219219 *
    220  * Works only if the stylesheet has already been added.
     220 * Works only if the stylesheet has already been registered.
    221221 *
    222222 * Possible values for $key and $value:
    223223 * 'conditional' string      Comments for IE 6, lte IE 7 etc.