wp/wp-includes/widgets/class-wp-widget-text.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
--- a/wp/wp-includes/widgets/class-wp-widget-text.php	Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/widgets/class-wp-widget-text.php	Wed Sep 21 18:19:35 2022 +0200
@@ -34,6 +34,7 @@
 			'classname'                   => 'widget_text',
 			'description'                 => __( 'Arbitrary text.' ),
 			'customize_selective_refresh' => true,
+			'show_instance_in_rest'       => true,
 		);
 		$control_ops = array(
 			'width'  => 400,
@@ -45,8 +46,8 @@
 	/**
 	 * Add hooks for enqueueing assets when registering all widget instances of this widget class.
 	 *
-	 * @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 );
@@ -193,7 +194,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.
@@ -270,12 +271,12 @@
 		 * Filters the content of the Text widget.
 		 *
 		 * @since 2.3.0
-		 * @since 4.4.0 Added the `$this` parameter.
-		 * @since 4.8.1 The `$this` param may now be a `WP_Widget_Custom_HTML` object in addition to a `WP_Widget_Text` object.
+		 * @since 4.4.0 Added the `$widget` parameter.
+		 * @since 4.8.1 The `$widget` param may now be a `WP_Widget_Custom_HTML` object in addition to a `WP_Widget_Text` object.
 		 *
 		 * @param string                               $text     The widget content.
 		 * @param array                                $instance Array of settings for the current widget.
-		 * @param WP_Widget_Text|WP_Widget_Custom_HTML $this     Current Text widget instance.
+		 * @param WP_Widget_Text|WP_Widget_Custom_HTML $widget   Current text or HTML widget instance.
 		 */
 		$text = apply_filters( 'widget_text', $text, $instance, $this );
 
@@ -290,7 +291,7 @@
 			 *
 			 * @param string         $text     The widget content.
 			 * @param array          $instance Array of settings for the current widget.
-			 * @param WP_Widget_Text $this     Current Text widget instance.
+			 * @param WP_Widget_Text $widget   Current Text widget instance.
 			 */
 			$text = apply_filters( 'widget_text_content', $text, $instance, $this );
 		} else {
@@ -331,7 +332,7 @@
 
 		$text = preg_replace_callback( '#<(video|iframe|object|embed)\s[^>]*>#i', array( $this, 'inject_video_max_width_style' ), $text );
 
-		// 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.
 		$text = wp_targeted_link_rel( $text );
 
 		?>
@@ -489,7 +490,7 @@
 			<input id="<?php echo $this->get_field_id( 'visual' ); ?>" name="<?php echo $this->get_field_name( 'visual' ); ?>" class="visual" type="hidden" value="">
 			<p>
 				<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
-				<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>"/>
+				<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
 			</p>
 			<div class="notice inline notice-info notice-alt">
 				<?php if ( ! isset( $instance['visual'] ) ) : ?>