From fcc79f847adf0d5467cae4be44152d1cec585f79 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 2 Sep 2021 08:30:58 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@51726 git-svn-id: http://core.svn.wordpress.org/trunk@51332 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.wp-scripts.php | 6 +++--- wp-includes/functions.wp-styles.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/functions.wp-scripts.php b/wp-includes/functions.wp-scripts.php index abe930758d..82d3685672 100644 --- a/wp-includes/functions.wp-scripts.php +++ b/wp-includes/functions.wp-scripts.php @@ -186,7 +186,7 @@ function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_f /** * Localize a script. * - * Works only if the script has already been added. + * Works only if the script has already been registered. * * Accepts an associative array $l10n and creates a JavaScript object: * @@ -224,7 +224,7 @@ function wp_localize_script( $handle, $object_name, $l10n ) { /** * Sets translated strings for a script. * - * Works only if the script has already been added. + * Works only if the script has already been registered. * * @see WP_Scripts::set_translations() * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. @@ -402,7 +402,7 @@ function wp_script_is( $handle, $list = 'enqueued' ) { /** * Add metadata to a script. * - * Works only if the script has already been added. + * Works only if the script has already been registered. * * Possible values for $key and $value: * 'conditional' string Comments for IE 6, lte IE 7, etc. diff --git a/wp-includes/functions.wp-styles.php b/wp-includes/functions.wp-styles.php index e1749477ca..d82bb55925 100644 --- a/wp-includes/functions.wp-styles.php +++ b/wp-includes/functions.wp-styles.php @@ -217,7 +217,7 @@ function wp_style_is( $handle, $list = 'enqueued' ) { /** * Add metadata to a CSS stylesheet. * - * Works only if the stylesheet has already been added. + * Works only if the stylesheet has already been registered. * * Possible values for $key and $value: * 'conditional' string Comments for IE 6, lte IE 7 etc. diff --git a/wp-includes/version.php b/wp-includes/version.php index b4919e6c3e..fede7b9da4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51725'; +$wp_version = '5.9-alpha-51726'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.