diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php
index 124b1c2440..267d16c3b1 100644
--- a/wp-includes/default-filters.php
+++ b/wp-includes/default-filters.php
@@ -630,6 +630,7 @@ add_filter( 'nav_menu_item_id', '_nav_menu_item_id_use_once', 10, 2 );
// Widgets.
add_action( 'after_setup_theme', 'wp_setup_widgets_block_editor', 1 );
add_action( 'init', 'wp_widgets_init', 1 );
+add_action( 'change_locale', array( 'WP_Widget_Media', 'reset_default_labels' ) );
// Admin Bar.
// Don't remove. Wrong way to disable.
diff --git a/wp-includes/version.php b/wp-includes/version.php
index bd0eb0d365..612cb560b6 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '6.0-alpha-53157';
+$wp_version = '6.0-alpha-53158';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
diff --git a/wp-includes/widgets/class-wp-widget-media.php b/wp-includes/widgets/class-wp-widget-media.php
index e1bd5de9b3..a68df4b776 100644
--- a/wp-includes/widgets/class-wp-widget-media.php
+++ b/wp-includes/widgets/class-wp-widget-media.php
@@ -41,6 +41,22 @@ abstract class WP_Widget_Media extends WP_Widget {
*/
protected $registered = false;
+ /**
+ * The default widget description.
+ *
+ * @since 6.0.0
+ * @var string
+ */
+ protected static $default_description = '';
+
+ /**
+ * The default localized strings used by the widget.
+ *
+ * @since 6.0.0
+ * @var string[]
+ */
+ protected static $l10n_defaults = array();
+
/**
* Constructor.
*
@@ -57,7 +73,7 @@ abstract class WP_Widget_Media extends WP_Widget {
$widget_opts = wp_parse_args(
$widget_options,
array(
- 'description' => __( 'A media item.' ),
+ 'description' => self::get_default_description(),
'customize_selective_refresh' => true,
'show_instance_in_rest' => true,
'mime_type' => '',
@@ -66,23 +82,7 @@ abstract class WP_Widget_Media extends WP_Widget {
$control_opts = wp_parse_args( $control_options, array() );
- $l10n_defaults = array(
- 'no_media_selected' => __( 'No media selected' ),
- 'add_media' => _x( 'Add Media', 'label for button in the media widget' ),
- 'replace_media' => _x( 'Replace Media', 'label for button in the media widget; should preferably not be longer than ~13 characters long' ),
- 'edit_media' => _x( 'Edit Media', 'label for button in the media widget; should preferably not be longer than ~13 characters long' ),
- 'add_to_widget' => __( 'Add to Widget' ),
- 'missing_attachment' => sprintf(
- /* translators: %s: URL to media library. */
- __( 'That file cannot be found. Check your media library and make sure it was not deleted.' ),
- esc_url( admin_url( 'upload.php' ) )
- ),
- /* translators: %d: Widget count. */
- 'media_library_state_multi' => _n_noop( 'Media Widget (%d)', 'Media Widget (%d)' ),
- 'media_library_state_single' => __( 'Media Widget' ),
- 'unsupported_file_type' => __( 'Looks like this is not the correct kind of file. Please link to an appropriate file instead.' ),
- );
- $this->l10n = array_merge( $l10n_defaults, array_filter( $this->l10n ) );
+ $this->l10n = array_merge( self::get_l10n_defaults(), array_filter( $this->l10n ) );
parent::__construct(
$id_base,
@@ -440,6 +440,16 @@ abstract class WP_Widget_Media extends WP_Widget {
__( 'No media selected' ),
+ 'add_media' => _x( 'Add Media', 'label for button in the media widget' ),
+ 'replace_media' => _x( 'Replace Media', 'label for button in the media widget; should preferably not be longer than ~13 characters long' ),
+ 'edit_media' => _x( 'Edit Media', 'label for button in the media widget; should preferably not be longer than ~13 characters long' ),
+ 'add_to_widget' => __( 'Add to Widget' ),
+ 'missing_attachment' => sprintf(
+ /* translators: %s: URL to media library. */
+ __( 'That file cannot be found. Check your media library and make sure it was not deleted.' ),
+ esc_url( admin_url( 'upload.php' ) )
+ ),
+ /* translators: %d: Widget count. */
+ 'media_library_state_multi' => _n_noop( 'Media Widget (%d)', 'Media Widget (%d)' ),
+ 'media_library_state_single' => __( 'Media Widget' ),
+ 'unsupported_file_type' => __( 'Looks like this is not the correct kind of file. Please link to an appropriate file instead.' ),
+ );
+
+ return self::$l10n_defaults;
+ }
}