diff --git a/src/wp-includes/blocks/categories.php b/src/wp-includes/blocks/categories.php index 7e3979b7aefe2..c35376505b134 100644 --- a/src/wp-includes/blocks/categories.php +++ b/src/wp-includes/blocks/categories.php @@ -70,8 +70,7 @@ function render_block_core_categories( $attributes ) { function build_dropdown_script_block_core_categories( $dropdown_id ) { ob_start(); ?> - ', '' ), '', ob_get_clean() ) ); } /** diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 5f588a0cd4a00..aebcfeb892dfb 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -464,19 +464,17 @@ protected function wp_die( $ajax_message, $message = null ) { ), 'error' => $ajax_message, ); - wp_print_inline_script_tag( - static function () use ( $settings ) { - ?> - - + + ', '' ), '', ob_get_clean() ) ); } wp_die( $message ); @@ -2087,33 +2085,31 @@ public function remove_frameless_preview_messenger_channel() { if ( ! $this->messenger_channel ) { return; } - wp_print_inline_script_tag( - static function () { - ?> - - + + ', '' ), '', ob_get_clean() ) ); } /** @@ -2209,34 +2205,32 @@ public function customize_preview_settings() { } } - wp_print_inline_script_tag( - function () use ( $settings ) { - ?> - + ob_start(); + ?> + + ', '' ), '', ob_get_clean() ) ); } /** @@ -4988,46 +4982,44 @@ public function customize_pane_settings() { } } - wp_print_inline_script_tag( - function () use ( $settings ) { - ?> - - + + ', '' ), '', ob_get_clean() ) ); } /** diff --git a/src/wp-includes/class-wp-customize-widgets.php b/src/wp-includes/class-wp-customize-widgets.php index 93006ef91671e..8e2de7e0d64fa 100644 --- a/src/wp-includes/class-wp-customize-widgets.php +++ b/src/wp-includes/class-wp-customize-widgets.php @@ -1310,12 +1310,10 @@ public function export_preview_data() { foreach ( $settings['registeredWidgets'] as &$registered_widget ) { unset( $registered_widget['callback'] ); // May not be JSON-serializeable. } - - ?> - - - - + var tinyMCEPreInit = { + baseURL: "", + suffix: "", + mceInit: {}, + qtInit: {}, + load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');} + }; + + + \n" . self::wp_mce_translation() . "\n"; } /** @@ -1619,29 +1615,26 @@ public static function editor_js() { * @param array $mce_settings TinyMCE settings array. */ do_action( 'before_wp_tiny_mce', self::$mce_settings ); - wp_print_inline_script_tag( - static function () use ( $baseurl, $suffix, $mce_init, $qt_init, $ref ) { - ?> - - + tinyMCEPreInit = { + baseURL: "", + suffix: "", + + mceInit: , + qtInit: , + ref: , + load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');} + }; + + - - + ID; - wp_print_inline_script_tag( - static function () use ( $name ) { - ?> - - '; } - ); + + if ( window.addEventListener ) { + window.addEventListener( 'unload', function() { window.name = ''; }, false ); + } + }()); + + ', '' ), '', ob_get_clean() ) ); } /** diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 249a41aae99c9..20c6e70cae7ca 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -2828,10 +2828,9 @@ function wp_print_script_tag( $attributes ) { * Automatically injects type attribute if needed. * * @since 5.7.0 - * @since 6.4.0 The $javascript argument can also be a Closure. * - * @param string|Closure $javascript Inline JavaScript code, or a Closure prints a string starting with ``. - * @param array $attributes Optional. Key-value pairs representing `' === strtolower( substr( $javascript, strlen( $javascript ) - 9, 9 ) ) ) { - $javascript = substr( $javascript, 0, strlen( $javascript ) - 9 ); - } else { - _doing_it_wrong( __FUNCTION__, __( 'Closure output expected to end with script end tag.' ), '6.4' ); - } - } - // Ensure markup is XHTML compatible if not HTML5. if ( ! $is_html5 ) { $javascript = sprintf( "/* */", $javascript ); @@ -2892,10 +2872,9 @@ function wp_get_inline_script_tag( $javascript, $attributes = array() ) { * Automatically injects type attribute if needed. * * @since 5.7.0 - * @since 6.4.0 The $javascript argument can also be a Closure. * - * @param string|Closure $javascript Inline JavaScript code, or a Closure prints a string starting with ``. - * @param array $attributes Optional. Key-value pairs representing ` - + + ', '' ), '', ob_get_clean() ) ); } /** diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index a43d30d3e10e2..79b5e62b54211 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -3742,27 +3742,25 @@ function wp_customize_support_script() { $admin_origin = parse_url( admin_url() ); $home_origin = parse_url( home_url() ); $cross_domain = ( strtolower( $admin_origin['host'] ) !== strtolower( $home_origin['host'] ) ); - wp_print_inline_script_tag( - static function () use ( $cross_domain ) { - ?> - - + + ', '' ), '', ob_get_clean() ) ); } /** diff --git a/src/wp-includes/widgets/class-wp-widget-archives.php b/src/wp-includes/widgets/class-wp-widget-archives.php index f32aa9bbb0254..21d3a7b67293a 100644 --- a/src/wp-includes/widgets/class-wp-widget-archives.php +++ b/src/wp-includes/widgets/class-wp-widget-archives.php @@ -100,8 +100,6 @@ public function widget( $args, $instance ) { $label = __( 'Select Post' ); break; } - - $type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type="text/javascript"'; ?> @@ -109,8 +107,8 @@ public function widget( $args, $instance ) { -> -/* + ', '' ), '', ob_get_clean() ) ); } else { $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml'; diff --git a/src/wp-includes/widgets/class-wp-widget-categories.php b/src/wp-includes/widgets/class-wp-widget-categories.php index 3c009709ba9f5..e00ce7f9605a3 100644 --- a/src/wp-includes/widgets/class-wp-widget-categories.php +++ b/src/wp-includes/widgets/class-wp-widget-categories.php @@ -92,11 +92,10 @@ public function widget( $args, $instance ) { echo ''; - $type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type="text/javascript"'; + ob_start(); ?> -> -/* (function() { var dropdown = document.getElementById( "" ); function onCatChange() { @@ -106,10 +105,10 @@ function onCatChange() { } dropdown.onchange = onCatChange; })(); -/* ]]> */ ', '' ), '', ob_get_clean() ) ); } else { $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';