diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 0a8c743019d80..3026d3b039136 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -479,7 +479,7 @@ protected function wp_die( $ajax_message, $message = null ) { } )( wp.customize, ); $this->preview_nav_menu_instance_args, ); - wp_print_inline_script_tag( sprintf( 'var _wpCustomizePreviewNavMenusExports = %s;', wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) ); + wp_print_inline_script_tag( sprintf( 'var _wpCustomizePreviewNavMenusExports = %s;', wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) ); } /** diff --git a/src/wp-includes/class-wp-customize-widgets.php b/src/wp-includes/class-wp-customize-widgets.php index fba534106f8a8..6420e2202865d 100644 --- a/src/wp-includes/class-wp-customize-widgets.php +++ b/src/wp-includes/class-wp-customize-widgets.php @@ -1335,7 +1335,7 @@ public function export_preview_data() { unset( $registered_widget['callback'] ); // May not be JSON-serializable. } wp_print_inline_script_tag( - sprintf( 'var _wpWidgetCustomizerPreviewSettings = %s;', wp_json_encode( $settings, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) + sprintf( 'var _wpWidgetCustomizerPreviewSettings = %s;', wp_json_encode( $settings, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) ); } diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php index b5d37f5aae081..143920f3c3fdc 100644 --- a/src/wp-includes/comment-template.php +++ b/src/wp-includes/comment-template.php @@ -1374,7 +1374,7 @@ function wp_comment_form_unfiltered_html_nonce() { if ( current_user_can( 'unfiltered_html' ) ) { wp_nonce_field( 'unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment_disabled', false ); - wp_print_inline_script_tag( "(function(){if(window===window.parent){document.getElementById('_wp_unfiltered_html_comment_disabled').name='_wp_unfiltered_html_comment';}})();" ); + wp_print_inline_script_tag( "(function(){if(window===window.parent){document.getElementById('_wp_unfiltered_html_comment_disabled').name='_wp_unfiltered_html_comment';}})();\n//# sourceURL=" . rawurlencode( __FUNCTION__ ) ); } } diff --git a/src/wp-includes/customize/class-wp-customize-selective-refresh.php b/src/wp-includes/customize/class-wp-customize-selective-refresh.php index f695338657828..f51b1e6dc7627 100644 --- a/src/wp-includes/customize/class-wp-customize-selective-refresh.php +++ b/src/wp-includes/customize/class-wp-customize-selective-refresh.php @@ -193,7 +193,7 @@ public function export_preview_data() { ); // Export data to JS. - wp_print_inline_script_tag( sprintf( 'var _customizePartialRefreshExports = %s;', wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) ); + wp_print_inline_script_tag( sprintf( 'var _customizePartialRefreshExports = %s;', wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) ); } /** diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php index 937dd6fb27869..c558622876122 100644 --- a/src/wp-includes/embed.php +++ b/src/wp-includes/embed.php @@ -518,8 +518,9 @@ function get_post_embed_html( $width, $height, $post = null ) { * will fail to match and everything will be matched by `.*` and not included in the group. This regex issue goes * back to WordPress 4.4, so in order to not break older installs this script must come at the end. */ + $js_path = '/js/wp-embed' . wp_scripts_get_suffix() . '.js'; $output .= wp_get_inline_script_tag( - file_get_contents( ABSPATH . WPINC . '/js/wp-embed' . wp_scripts_get_suffix() . '.js' ) + file_get_contents( ABSPATH . WPINC . $js_path ) . "\n//# sourceURL=" . includes_url( $js_path ) ); /** @@ -1090,8 +1091,9 @@ function wp_enqueue_embed_styles() { * @since 4.4.0 */ function print_embed_scripts() { + $js_path = '/js/wp-embed-template' . wp_scripts_get_suffix() . '.js'; wp_print_inline_script_tag( - file_get_contents( ABSPATH . WPINC . '/js/wp-embed-template' . wp_scripts_get_suffix() . '.js' ) + file_get_contents( ABSPATH . WPINC . $js_path ) . "\n//# sourceURL=" . includes_url( $js_path ) ); } diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index c420ebc232f1c..42d029c78ae1f 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -7797,6 +7797,7 @@ function wp_post_preview_js() { window.addEventListener( 'pagehide', function() { window.name = ''; } ); } }()); + //# sourceURL=