Changeset 61518 for trunk/src/wp-includes/deprecated.php
- Timestamp:
- 01/23/2026 05:02:27 PM (4 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/deprecated.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/deprecated.php
r61487 r61518 6480 6480 <?php 6481 6481 } 6482 6483 /** 6484 * Sanitizes an attributes array into an attributes string to be placed inside a `<script>` tag. 6485 * 6486 * This function is deprecated, use {@see wp_get_script_tag()} or {@see wp_get_inline_script_tag()} instead. 6487 * 6488 * @since 5.7.0 6489 * @deprecated 7.0.0 Use wp_get_script_tag() or wp_get_inline_script_tag(). 6490 * @see wp_get_script_tag() 6491 * @see wp_get_inline_script_tag() 6492 * 6493 * @param array<string, string|bool> $attributes Key-value pairs representing `<script>` tag attributes. 6494 * @return string String made of sanitized `<script>` tag attributes. 6495 */ 6496 function wp_sanitize_script_attributes( $attributes ) { 6497 _deprecated_function( __FUNCTION__, '7.0.0', 'wp_get_script_tag() or wp_get_inline_script_tag()' ); 6498 6499 $attributes_string = ''; 6500 foreach ( $attributes as $attribute_name => $attribute_value ) { 6501 if ( is_bool( $attribute_value ) ) { 6502 if ( $attribute_value ) { 6503 $attributes_string .= ' ' . esc_attr( $attribute_name ); 6504 } 6505 } else { 6506 $attributes_string .= sprintf( ' %1$s="%2$s"', esc_attr( $attribute_name ), esc_attr( $attribute_value ) ); 6507 } 6508 } 6509 return $attributes_string; 6510 } 6511
Note: See TracChangeset
for help on using the changeset viewer.