@@ -141,7 +141,7 @@ function wp_add_inline_script( $handle, $data, $position = 'after' ) {
141141 ),
142142 '4.5.0 '
143143 );
144- $ data = trim ( preg_replace ( '#<script[^>]*>(.*)</script>#is ' , '$1 ' , $ data ) );
144+ $ data = trim ( ( string ) preg_replace ( '#<script[^>]*>(.*)</script>#is ' , '$1 ' , $ data ) );
145145 }
146146
147147 return wp_scripts ()->add_inline_script ( $ handle , $ data , $ position );
@@ -160,15 +160,15 @@ function wp_add_inline_script( $handle, $data, $position = 'after' ) {
160160 * @since 6.3.0 The $in_footer parameter of type boolean was overloaded to be an $args parameter of type array.
161161 * @since 6.9.0 The $fetchpriority parameter of type string was added to the $args parameter of type array.
162162 *
163- * @param string $handle Name of the script. Should be unique.
164- * @param string|false $src Full URL of the script, or path of the script relative to the WordPress root directory.
165- * If source is set to false, script is an alias of other scripts it depends on.
166- * @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array.
167- * @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
168- * as a query string for cache busting purposes. If version is set to false, a version
169- * number is automatically added equal to current installed WordPress version.
170- * If set to null, no version is added.
171- * @param array|bool $args {
163+ * @param string $handle Name of the script. Should be unique.
164+ * @param string|false $src Full URL of the script, or path of the script relative to the WordPress root directory.
165+ * If source is set to false, script is an alias of other scripts it depends on.
166+ * @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array.
167+ * @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
168+ * as a query string for cache busting purposes. If version is set to false, a version
169+ * number is automatically added equal to current installed WordPress version.
170+ * If set to null, no version is added.
171+ * @param array<string, string |bool>|bool $args {
172172 * Optional. An array of additional script loading strategies. Default empty array.
173173 * Otherwise, it may be a boolean in which case it determines whether the script is printed in the footer. Default false.
174174 *
@@ -221,10 +221,10 @@ function wp_register_script( $handle, $src, $deps = array(), $ver = false, $args
221221 *
222222 * @todo Documentation cleanup
223223 *
224- * @param string $handle Script handle the data will be attached to.
225- * @param string $object_name Name for the JavaScript object. Passed directly, so it should be qualified JS variable.
226- * Example: '/[a-zA-Z0-9_]+/'.
227- * @param array $l10n The data itself. The data can be either a single or multi-dimensional array.
224+ * @param string $handle Script handle the data will be attached to.
225+ * @param string $object_name Name for the JavaScript object. Passed directly, so it should be qualified JS variable.
226+ * Example: '/[a-zA-Z0-9_]+/'.
227+ * @param array<string, mixed> $l10n The data itself. The data can be either a single or multi-dimensional array.
228228 * @return bool True if the script was successfully localized, false otherwise.
229229 */
230230function wp_localize_script ( $ handle , $ object_name , $ l10n ) {
@@ -346,15 +346,15 @@ function wp_deregister_script( $handle ) {
346346 * @since 6.3.0 The $in_footer parameter of type boolean was overloaded to be an $args parameter of type array.
347347 * @since 6.9.0 The $fetchpriority parameter of type string was added to the $args parameter of type array.
348348 *
349- * @param string $handle Name of the script. Should be unique.
350- * @param string $src Full URL of the script, or path of the script relative to the WordPress root directory.
351- * Default empty.
352- * @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array.
353- * @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
354- * as a query string for cache busting purposes. If version is set to false, a version
355- * number is automatically added equal to current installed WordPress version.
356- * If set to null, no version is added.
357- * @param array|bool $args {
349+ * @param string $handle Name of the script. Should be unique.
350+ * @param string $src Full URL of the script, or path of the script relative to the WordPress root directory.
351+ * Default empty.
352+ * @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array.
353+ * @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
354+ * as a query string for cache busting purposes. If version is set to false, a version
355+ * number is automatically added equal to current installed WordPress version.
356+ * If set to null, no version is added.
357+ * @param array<string, string |bool>|bool $args {
358358 * Optional. An array of additional script loading strategies. Default empty array.
359359 * Otherwise, it may be a boolean in which case it determines whether the script is printed in the footer. Default false.
360360 *
0 commit comments