--- a/wp/wp-includes/widgets/class-wp-widget-custom-html.php Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/widgets/class-wp-widget-custom-html.php Fri Sep 05 18:40:08 2025 +0200
@@ -69,14 +69,16 @@
}
$this->registered = true;
- wp_add_inline_script( 'custom-html-widgets', sprintf( 'wp.customHtmlWidgets.idBases.push( %s );', wp_json_encode( $this->id_base ) ) );
-
- // Note that the widgets component in the customizer will also do
- // the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts().
+ /*
+ * Note that the widgets component in the customizer will also do
+ * the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts().
+ */
add_action( 'admin_print_scripts-widgets.php', array( $this, 'enqueue_admin_scripts' ) );
- // Note that the widgets component in the customizer will also do
- // the 'admin_footer-widgets.php' action in WP_Customize_Widgets::print_footer_scripts().
+ /*
+ * Note that the widgets component in the customizer will also do
+ * the 'admin_footer-widgets.php' action in WP_Customize_Widgets::print_footer_scripts().
+ */
add_action( 'admin_footer-widgets.php', array( 'WP_Widget_Custom_HTML', 'render_control_template_scripts' ) );
// Note this action is used to ensure the help text is added to the end.
@@ -216,6 +218,8 @@
);
wp_enqueue_script( 'custom-html-widgets' );
+ wp_add_inline_script( 'custom-html-widgets', sprintf( 'wp.customHtmlWidgets.idBases.push( %s );', wp_json_encode( $this->id_base ) ) );
+
if ( empty( $settings ) ) {
$settings = array(
'disabled' => true,
@@ -314,7 +318,7 @@
'class="external-link" target="_blank"',
sprintf(
'<span class="screen-reader-text"> %s</span>',
- /* translators: Accessibility text. */
+ /* translators: Hidden accessibility text. */
__( '(opens in a new tab)' )
)
);