Skip to content

Commit 3edd50e

Browse files
Copilotsirreal
andcommitted
Add comment explaining wp_print_inline_script_tag return parameter
Co-authored-by: sirreal <[email protected]>
1 parent 16c9b3f commit 3edd50e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wp-includes/class-wp-scripts.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,10 @@ public function do_item( $handle, $group = false ) {
533533
$json_encode_flags = JSON_HEX_TAG | JSON_UNESCAPED_SLASHES;
534534
}
535535

536+
/*
537+
* Return the data script tag as a string (third parameter false) rather than echoing it.
538+
* This allows it to be included with the script tag in the concatenated output.
539+
*/
536540
$data_tag = wp_print_inline_script_tag(
537541
(string) wp_json_encode(
538542
$script_data,

0 commit comments

Comments
 (0)