<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[60913] trunk/src: Bundled Themes: Use `wp_print_inline_script_tag()` when available and include `sourceURL` for JS.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/60913">60913</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/60913","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>westonruter</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2025-10-07 23:32:04 +0000 (Tue, 07 Oct 2025)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Bundled Themes: Use `wp_print_inline_script_tag()` when available and include `sourceURL` for JS.
Instead of manually constructing the markup for `SCRIPT` tags, leverage `wp_print_inline_script_tag()` when available to do the construction while also ensuring filters may inject additional attributes on the `SCRIPT` tags, such as `nonce` for CSP. When the function is not available (prior to WP 5.7), fall back to the manual markup construction.
This also adds the `sourceURL` comments to the inline scripts to facilitate debugging, per <a href="https://core.trac.wordpress.org/ticket/63887">#63887</a>.
Developed in https://github.com/WordPress/wordpress-develop/pull/9416.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/60909">[60909]</a>, <a href="https://core.trac.wordpress.org/changeset/60899">[60899]</a>.
Props debarghyabanerjee, westonruter, hbhalodia, peterwilsoncc, sabernhardt, poena.
See <a href="https://core.trac.wordpress.org/ticket/63887">#63887</a>, <a href="https://core.trac.wordpress.org/ticket/59446">#59446</a>.
Fixes <a href="https://core.trac.wordpress.org/ticket/63806">#63806</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpcontentthemestwentyfifteenfunctionsphp">trunk/src/wp-content/themes/twentyfifteen/functions.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfifteeninccustomizerphp">trunk/src/wp-content/themes/twentyfifteen/inc/customizer.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeenfunctionsphp">trunk/src/wp-content/themes/twentyseventeen/functions.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentysixteenfunctionsphp">trunk/src/wp-content/themes/twentysixteen/functions.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentysixteeninccustomizerphp">trunk/src/wp-content/themes/twentysixteen/inc/customizer.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentytwentyinctemplatetagsphp">trunk/src/wp-content/themes/twentytwenty/inc/template-tags.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentytwentyoneclassesclasstwentytwentyonedarkmodephp">trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentytwentyonefunctionsphp">trunk/src/wp-content/themes/twentytwentyone/functions.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentytwentyoneinctemplatefunctionsphp">trunk/src/wp-content/themes/twentytwentyone/inc/template-functions.php</a></li>
<li><a href="#trunksrcwpincludesembedphp">trunk/src/wp-includes/embed.php</a></li>
<li><a href="#trunksrcwpincludesformattingphp">trunk/src/wp-includes/formatting.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpcontentthemestwentyfifteenfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyfifteen/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyfifteen/functions.php 2025-10-07 14:28:22 UTC (rev 60912)
+++ trunk/src/wp-content/themes/twentyfifteen/functions.php 2025-10-07 23:32:04 UTC (rev 60913)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -412,7 +412,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Twenty Fifteen 1.1
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function twentyfifteen_javascript_detection() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $js = "(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);";
+ $js .= "\n//# sourceURL=" . rawurlencode( __FUNCTION__ );
+
+ if ( function_exists( 'wp_print_inline_script_tag' ) ) {
+ wp_print_inline_script_tag( $js );
+ } else {
+ echo "<script>$js</script>\n";
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'wp_head', 'twentyfifteen_javascript_detection', 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfifteeninccustomizerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyfifteen/inc/customizer.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyfifteen/inc/customizer.php 2025-10-07 14:28:22 UTC (rev 60912)
+++ trunk/src/wp-content/themes/twentyfifteen/inc/customizer.php 2025-10-07 23:32:04 UTC (rev 60913)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -772,10 +772,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Outputs an Underscore template for generating CSS for the color scheme.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The template generates the css dynamically for instant display in the Customizer
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The template generates the CSS dynamically for instant display in the Customizer
</ins><span class="cx" style="display: block; padding: 0 10px"> * preview.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Twenty Fifteen 1.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since Twenty Fifteen 4.1 Added `wp_print_inline_script_tag()` support.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function twentyfifteen_color_scheme_css_template() {
</span><span class="cx" style="display: block; padding: 0 10px"> $colors = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -792,10 +793,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'secondary_sidebar_textcolor' => '{{ data.secondary_sidebar_textcolor }}',
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta_box_background_color' => '{{ data.meta_box_background_color }}',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <script type="text/html" id="tmpl-twentyfifteen-color-scheme">
- <?php echo twentyfifteen_get_color_scheme_css( $colors ); ?>
- </script>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $css_template = twentyfifteen_get_color_scheme_css( $colors );
+
+ if ( function_exists( 'wp_print_inline_script_tag' ) ) {
+ wp_print_inline_script_tag(
+ $css_template,
+ array(
+ 'type' => 'text/html',
+ 'id' => 'tmpl-twentyfifteen-color-scheme',
+ )
+ );
+ } else {
+ echo '<script type="text/html" id="tmpl-twentyfifteen-color-scheme">' . $css_template . '</script>';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'customize_controls_print_footer_scripts', 'twentyfifteen_color_scheme_css_template' );
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeenfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/functions.php 2025-10-07 14:28:22 UTC (rev 60912)
+++ trunk/src/wp-content/themes/twentyseventeen/functions.php 2025-10-07 23:32:04 UTC (rev 60913)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -406,7 +406,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Twenty Seventeen 1.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function twentyseventeen_javascript_detection() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $js = "(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);";
+ $js .= "\n//# sourceURL=" . rawurlencode( __FUNCTION__ );
+
+ if ( function_exists( 'wp_print_inline_script_tag' ) ) {
+ wp_print_inline_script_tag( $js );
+ } else {
+ echo "<script>$js</script>\n";
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'wp_head', 'twentyseventeen_javascript_detection', 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentysixteenfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentysixteen/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentysixteen/functions.php 2025-10-07 14:28:22 UTC (rev 60912)
+++ trunk/src/wp-content/themes/twentysixteen/functions.php 2025-10-07 23:32:04 UTC (rev 60913)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -373,7 +373,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Twenty Sixteen 1.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function twentysixteen_javascript_detection() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $js = "(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);";
+ $js .= "\n//# sourceURL=" . rawurlencode( __FUNCTION__ );
+
+ if ( function_exists( 'wp_print_inline_script_tag' ) ) {
+ wp_print_inline_script_tag( $js );
+ } else {
+ echo "<script>$js</script>\n";
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'wp_head', 'twentysixteen_javascript_detection', 0 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentysixteeninccustomizerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentysixteen/inc/customizer.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentysixteen/inc/customizer.php 2025-10-07 14:28:22 UTC (rev 60912)
+++ trunk/src/wp-content/themes/twentysixteen/inc/customizer.php 2025-10-07 23:32:04 UTC (rev 60913)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -838,6 +838,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Customizer preview.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Twenty Sixteen 1.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since Twenty Sixteen 4.1 Added `wp_print_inline_script_tag()` support.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function twentysixteen_color_scheme_css_template() {
</span><span class="cx" style="display: block; padding: 0 10px"> $colors = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -848,11 +849,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'secondary_text_color' => '{{ data.secondary_text_color }}',
</span><span class="cx" style="display: block; padding: 0 10px"> 'border_color' => '{{ data.border_color }}',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <script type="text/html" id="tmpl-twentysixteen-color-scheme">
- <?php echo twentysixteen_get_color_scheme_css( $colors ); ?>
- </script>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $css_template = twentysixteen_get_color_scheme_css( $colors );
+
+ if ( function_exists( 'wp_print_inline_script_tag' ) ) {
+ wp_print_inline_script_tag(
+ $css_template,
+ array(
+ 'type' => 'text/html',
+ 'id' => 'tmpl-twentysixteen-color-scheme',
+ )
+ );
+ } else {
+ echo '<script type="text/html" id="tmpl-twentysixteen-color-scheme">' . $css_template . '</script>';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'customize_controls_print_footer_scripts', 'twentysixteen_color_scheme_css_template' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentytwentyinctemplatetagsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentytwenty/inc/template-tags.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentytwenty/inc/template-tags.php 2025-10-07 14:28:22 UTC (rev 60912)
+++ trunk/src/wp-content/themes/twentytwenty/inc/template-tags.php 2025-10-07 23:32:04 UTC (rev 60913)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -660,10 +660,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Twenty Twenty 1.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function twentytwenty_no_js_class() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $js = "document.documentElement.className = document.documentElement.className.replace( 'no-js', 'js' );";
+ $js .= "\n//# sourceURL=" . rawurlencode( __FUNCTION__ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <script>document.documentElement.className = document.documentElement.className.replace( 'no-js', 'js' );</script>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( function_exists( 'wp_print_inline_script_tag' ) ) {
+ wp_print_inline_script_tag( $js );
+ } else {
+ echo "<script>$js</script>\n";
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'wp_head', 'twentytwenty_no_js_class' );
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentytwentyoneclassesclasstwentytwentyonedarkmodephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php 2025-10-07 14:28:22 UTC (rev 60912)
+++ trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php 2025-10-07 23:32:04 UTC (rev 60913)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -363,9 +363,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function the_script() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<script>';
- include get_template_directory() . '/assets/js/dark-mode-toggler.js'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
- echo '</script>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $path = 'assets/js/dark-mode-toggler.js';
+ $js = rtrim( file_get_contents( trailingslashit( get_template_directory() ) . $path ) );
+ $js .= "\n//# sourceURL=" . esc_url_raw( trailingslashit( get_template_directory_uri() ) . $path );
+ if ( function_exists( 'wp_print_inline_script_tag' ) ) {
+ wp_print_inline_script_tag( $js );
+ } else {
+ printf( "<script>%s</script>\n", $js );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentytwentyonefunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentytwentyone/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentytwentyone/functions.php 2025-10-07 14:28:22 UTC (rev 60912)
+++ trunk/src/wp-content/themes/twentytwentyone/functions.php 2025-10-07 23:32:04 UTC (rev 60913)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -630,13 +630,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function twentytwentyone_add_ie_class() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <script>
- if ( -1 !== navigator.userAgent.indexOf( 'MSIE' ) || -1 !== navigator.appVersion.indexOf( 'Trident/' ) ) {
- document.body.classList.add( 'is-IE' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $script = "
+ if ( -1 !== navigator.userAgent.indexOf('MSIE') || -1 !== navigator.appVersion.indexOf('Trident/') ) {
+ document.body.classList.add('is-IE');
+ }
+ ";
+ $script .= '//# sourceURL=' . rawurlencode( __FUNCTION__ );
+
+ if ( function_exists( 'wp_print_inline_script_tag' ) ) {
+ wp_print_inline_script_tag( $script );
+ } else {
+ echo "<script>$script</script>\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </script>
- <?php
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'wp_footer', 'twentytwentyone_add_ie_class' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentytwentyoneinctemplatefunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentytwentyone/inc/template-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentytwentyone/inc/template-functions.php 2025-10-07 14:28:22 UTC (rev 60912)
+++ trunk/src/wp-content/themes/twentytwentyone/inc/template-functions.php 2025-10-07 23:32:04 UTC (rev 60913)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,7 +74,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return void
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function twenty_twenty_one_supports_js() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<script>document.body.classList.remove("no-js");</script>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $js = "document.body.classList.remove('no-js');";
+ $js .= "\n//# sourceURL=" . rawurlencode( __FUNCTION__ );
+
+ if ( function_exists( 'wp_print_inline_script_tag' ) ) {
+ wp_print_inline_script_tag( $js );
+ } else {
+ echo "<script>$js</script>\n";
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'wp_footer', 'twenty_twenty_one_supports_js' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesembedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/embed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/embed.php 2025-10-07 14:28:22 UTC (rev 60912)
+++ trunk/src/wp-includes/embed.php 2025-10-07 23:32:04 UTC (rev 60913)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -520,7 +520,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $js_path = '/js/wp-embed' . wp_scripts_get_suffix() . '.js';
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= wp_get_inline_script_tag(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trim( file_get_contents( ABSPATH . WPINC . $js_path ) ) . "\n//# sourceURL=" . includes_url( $js_path )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trim( file_get_contents( ABSPATH . WPINC . $js_path ) ) . "\n//# sourceURL=" . esc_url_raw( includes_url( $js_path ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1093,7 +1093,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function print_embed_scripts() {
</span><span class="cx" style="display: block; padding: 0 10px"> $js_path = '/js/wp-embed-template' . wp_scripts_get_suffix() . '.js';
</span><span class="cx" style="display: block; padding: 0 10px"> wp_print_inline_script_tag(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trim( file_get_contents( ABSPATH . WPINC . $js_path ) ) . "\n//# sourceURL=" . includes_url( $js_path )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trim( file_get_contents( ABSPATH . WPINC . $js_path ) ) . "\n//# sourceURL=" . esc_url_raw( includes_url( $js_path ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesformattingphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/formatting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/formatting.php 2025-10-07 14:28:22 UTC (rev 60912)
+++ trunk/src/wp-includes/formatting.php 2025-10-07 23:32:04 UTC (rev 60913)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5992,7 +5992,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $emoji_loader_script_path = '/js/wp-emoji-loader' . wp_scripts_get_suffix() . '.js';
</span><span class="cx" style="display: block; padding: 0 10px"> wp_print_inline_script_tag(
</span><span class="cx" style="display: block; padding: 0 10px"> rtrim( file_get_contents( ABSPATH . WPINC . $emoji_loader_script_path ) ) . "\n" .
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '//# sourceURL=' . includes_url( $emoji_loader_script_path ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ '//# sourceURL=' . esc_url_raw( includes_url( $emoji_loader_script_path ) ),
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'module',
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span></span></pre>
</div>
</div>
</body>
</html>