--- a/wp/wp-includes/widgets/class-wp-widget-media.php Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/widgets/class-wp-widget-media.php Wed Sep 21 18:19:35 2022 +0200
@@ -59,6 +59,7 @@
array(
'description' => __( 'A media item.' ),
'customize_selective_refresh' => true,
+ 'show_instance_in_rest' => true,
'mime_type' => '',
)
);
@@ -96,8 +97,8 @@
*
* @since 4.8.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 );
@@ -162,7 +163,7 @@
* @since 4.9.0
*
* @param array $schema Instance schema.
- * @param WP_Widget_Media $this Widget object.
+ * @param WP_Widget_Media $widget Widget object.
*/
$schema = apply_filters( "widget_{$this->id_base}_instance_schema", $schema, $this );
@@ -208,7 +209,7 @@
}
$tokens = array_map( 'sanitize_html_class', $tokens );
$tokens = array_filter( $tokens );
- return join( ' ', $tokens );
+ return implode( ' ', $tokens );
}
/**
@@ -245,7 +246,7 @@
*
* @param array $instance Instance data.
* @param array $args Widget args.
- * @param WP_Widget_Media $this Widget object.
+ * @param WP_Widget_Media $widget Widget object.
*/
$instance = apply_filters( "widget_{$this->id_base}_instance", $instance, $args, $this );
@@ -343,7 +344,7 @@
class="media-widget-instance-property"
name="<?php echo esc_attr( $this->get_field_name( $name ) ); ?>"
id="<?php echo esc_attr( $this->get_field_id( $name ) ); // Needed specifically by wpWidgets.appendTitle(). ?>"
- value="<?php echo esc_attr( is_array( $value ) ? join( ',', $value ) : strval( $value ) ); ?>"
+ value="<?php echo esc_attr( is_array( $value ) ? implode( ',', $value ) : (string) $value ); ?>"
/>
<?php
endforeach;