wp/wp-includes/widgets/class-wp-widget-custom-html.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 21 48c4eec2b7e6
--- a/wp/wp-includes/widgets/class-wp-widget-custom-html.php	Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/widgets/class-wp-widget-custom-html.php	Wed Sep 21 18:19:35 2022 +0200
@@ -45,6 +45,7 @@
 			'classname'                   => 'widget_custom_html',
 			'description'                 => __( 'Arbitrary HTML code.' ),
 			'customize_selective_refresh' => true,
+			'show_instance_in_rest'       => true,
 		);
 		$control_ops = array(
 			'width'  => 400,
@@ -58,8 +59,8 @@
 	 *
 	 * @since 4.9.0
 	 *
-	 * @param integer $number Optional. The unique order number of this widget instance
-	 *                        compared to other instances of the same class. Default -1.
+	 * @param int $number Optional. The unique order number of this widget instance
+	 *                    compared to other instances of the same class. Default -1.
 	 */
 	public function _register_one( $number = -1 ) {
 		parent::_register_one( $number );
@@ -83,7 +84,7 @@
 	}
 
 	/**
-	 * Filter gallery shortcode attributes.
+	 * Filters gallery shortcode attributes.
 	 *
 	 * Prevents all of a site's attachments from being shown in a gallery displayed on a
 	 * non-singular template where a $post context is not available.
@@ -146,7 +147,7 @@
 		/** This filter is documented in wp-includes/widgets/class-wp-widget-text.php */
 		$content = apply_filters( 'widget_text', $instance['content'], $simulated_text_widget_instance, $this );
 
-		// Adds noreferrer and noopener relationships, without duplicating values, to all HTML A elements that have a target.
+		// Adds 'noopener' relationship, without duplicating values, to all HTML A elements that have a target.
 		$content = wp_targeted_link_rel( $content );
 
 		/**
@@ -156,7 +157,7 @@
 		 *
 		 * @param string                $content  The widget content.
 		 * @param array                 $instance Array of settings for the current widget.
-		 * @param WP_Widget_Custom_HTML $this     Current Custom HTML widget instance.
+		 * @param WP_Widget_Custom_HTML $widget   Current Custom HTML widget instance.
 		 */
 		$content = apply_filters( 'widget_custom_html_content', $content, $instance, $this );
 
@@ -247,7 +248,7 @@
 	public function form( $instance ) {
 		$instance = wp_parse_args( (array) $instance, $this->default_instance );
 		?>
-		<input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" class="title sync-input" type="hidden" value="<?php echo esc_attr( $instance['title'] ); ?>"/>
+		<input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" class="title sync-input" type="hidden" value="<?php echo esc_attr( $instance['title'] ); ?>" />
 		<textarea id="<?php echo $this->get_field_id( 'content' ); ?>" name="<?php echo $this->get_field_name( 'content' ); ?>" class="content sync-input" hidden><?php echo esc_textarea( $instance['content'] ); ?></textarea>
 		<?php
 	}
@@ -281,7 +282,7 @@
 					<# if ( data.codeEditorDisabled ) { #>
 						<p>
 							<?php _e( 'Some HTML tags are not permitted, including:' ); ?>
-							<code><?php echo join( '</code>, <code>', $disallowed_html ); ?></code>
+							<code><?php echo implode( '</code>, <code>', $disallowed_html ); ?></code>
 						</p>
 					<# } #>
 				<?php endif; ?>