Make WordPress Core

Changeset 51726


Ignore:
Timestamp:
09/02/2021 08:29:03 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Provide a more accurate description for a few script and style functions.

This should make it clear that the functions only work if the script or style has already been registered.

This affects:

  • wp_localize_script()
  • wp_set_script_translations()
  • wp_script_add_data()
  • wp_style_add_data()

Follow-up to [7970], [18464], [25594], [31223], [36633], [44169], [44350].

Props audrasjb.
Fixes #54044.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.wp-scripts.php

    r51154 r51726  
    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:
     
    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()
     
    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:
  • trunk/src/wp-includes/functions.wp-styles.php

    r48070 r51726  
    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:
Note: See TracChangeset for help on using the changeset viewer.