WP_Widget_Media::get_l10n_defaults() WordPress Method

The WP_Widget_Media::get_l10n_defaults() method is used to get the default localized strings for the widget. This is used to allow the widget to be translated into different languages.

WP_Widget_Media::get_l10n_defaults() #

Returns the default localized strings used by the widget.


Return

((string|array)[])


Top ↑

Source

File: wp-includes/widgets/class-wp-widget-media.php

	protected static function get_l10n_defaults() {
		if ( ! empty( self::$l10n_defaults ) ) {
			return self::$l10n_defaults;
		}

		self::$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 <a href="%s">media library</a> 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;
	}


Top ↑

Changelog

Changelog
VersionDescription
6.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.