Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/wp-includes/class-wp-customize-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ protected function wp_die( $ajax_message, $message = null ) {
} )( wp.customize, <?php echo wp_json_encode( $settings, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?> );
</script>
<?php
$message .= wp_get_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) );
$message .= wp_get_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) );
}

wp_die( $message );
Expand Down Expand Up @@ -2105,7 +2105,7 @@ public function remove_frameless_preview_messenger_channel() {
} )();
</script>
<?php
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) );
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) );
}

/**
Expand Down Expand Up @@ -2227,7 +2227,7 @@ public function customize_preview_settings() {
})( _wpCustomizeSettings.values );
</script>
<?php
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) );
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) );
}

/**
Expand Down Expand Up @@ -5022,7 +5022,7 @@ public function customize_pane_settings() {
?>
</script>
<?php
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) );
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-customize-nav-menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@ public function export_preview_data() {
$exports = array(
'navMenuInstanceArgs' => $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__ ) );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-customize-widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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__ )
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/comment-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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__ ) );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__ ) );
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/wp-includes/embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
);

/**
Expand Down Expand Up @@ -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 )
);
}

Expand Down
1 change: 1 addition & 0 deletions src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7797,6 +7797,7 @@ function wp_post_preview_js() {
window.addEventListener( 'pagehide', function() { window.name = ''; } );
}
}());
//# sourceURL=<?php echo rawurlencode( __FUNCTION__ ); ?>
</script>
<?php
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -3815,7 +3815,7 @@ function wp_customize_support_script() {
}());
</script>
<?php
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) );
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) . "\n//# sourceURL=" . rawurlencode( __FUNCTION__ ) );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/widgets/class-wp-widget-archives.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function onSelectChange() {
})();
</script>
<?php
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) );
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) );
} else {
$format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';

Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/widgets/class-wp-widget-categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function onCatChange() {
</script>

<?php
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) );
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) );
} else {
$format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';

Expand Down
Loading