Changeset 60704 for trunk/src/wp-includes/functions.wp-scripts.php
- Timestamp:
- 09/03/2025 10:15:31 PM (5 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/functions.wp-scripts.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.wp-scripts.php
r58200 r60704 159 159 * @since 4.3.0 A return value was added. 160 160 * @since 6.3.0 The $in_footer parameter of type boolean was overloaded to be an $args parameter of type array. 161 * @since 6.9.0 The $fetchpriority parameter of type string was added to the $args parameter of type array. 161 162 * 162 163 * @param string $handle Name of the script. Should be unique. … … 172 173 * Otherwise, it may be a boolean in which case it determines whether the script is printed in the footer. Default false. 173 174 * 174 * @type string $strategy Optional. If provided, may be either 'defer' or 'async'. 175 * @type bool $in_footer Optional. Whether to print the script in the footer. Default 'false'. 175 * @type string $strategy Optional. If provided, may be either 'defer' or 'async'. 176 * @type bool $in_footer Optional. Whether to print the script in the footer. Default 'false'. 177 * @type string $fetchpriority Optional. The fetch priority for the script. Default 'auto'. 176 178 * } 177 179 * @return bool Whether the script has been registered. True on success, false on failure. … … 193 195 if ( ! empty( $args['strategy'] ) ) { 194 196 $wp_scripts->add_data( $handle, 'strategy', $args['strategy'] ); 197 } 198 if ( ! empty( $args['fetchpriority'] ) ) { 199 $wp_scripts->add_data( $handle, 'fetchpriority', $args['fetchpriority'] ); 195 200 } 196 201 return $registered; … … 340 345 * @since 2.1.0 341 346 * @since 6.3.0 The $in_footer parameter of type boolean was overloaded to be an $args parameter of type array. 347 * @since 6.9.0 The $fetchpriority parameter of type string was added to the $args parameter of type array. 342 348 * 343 349 * @param string $handle Name of the script. Should be unique. … … 353 359 * Otherwise, it may be a boolean in which case it determines whether the script is printed in the footer. Default false. 354 360 * 355 * @type string $strategy Optional. If provided, may be either 'defer' or 'async'. 356 * @type bool $in_footer Optional. Whether to print the script in the footer. Default 'false'. 361 * @type string $strategy Optional. If provided, may be either 'defer' or 'async'. 362 * @type bool $in_footer Optional. Whether to print the script in the footer. Default 'false'. 363 * @type string $fetchpriority Optional. The fetch priority for the script. Default 'auto'. 357 364 * } 358 365 */ … … 379 386 $wp_scripts->add_data( $_handle[0], 'strategy', $args['strategy'] ); 380 387 } 388 if ( ! empty( $args['fetchpriority'] ) ) { 389 $wp_scripts->add_data( $_handle[0], 'fetchpriority', $args['fetchpriority'] ); 390 } 381 391 } 382 392
Note: See TracChangeset
for help on using the changeset viewer.