WP_Widget_Media_Image::__construct()
- Since
- 4.8.0
- Source
wp-includes/widgets/class-wp-widget-media-image.php:25
Constructor.
Uses · 6
- __()Retrieves the translation of $text.
- _x()Retrieves translated string with gettext context.
- esc_url()Checks and cleans a URL.
- admin_url()Retrieves the URL to the admin area for the current site.
- _n_noop()Registers plural strings in POT file, but does not translate them.
- WP_Widget_Media::__construct()Constructor.
Source
public function __construct() { parent::__construct( 'media_image', __( 'Image' ), array( 'description' => __( 'Displays an image.' ), 'mime_type' => 'image', ) ); $this->l10n = array_merge( $this->l10n, array( 'no_media_selected' => __( 'No image selected' ), 'add_media' => _x( 'Add Image', 'label for button in the image widget' ), 'replace_media' => _x( 'Replace Image', 'label for button in the image widget; should preferably not be longer than ~13 characters long' ), 'edit_media' => _x( 'Edit Image', 'label for button in the image widget; should preferably not be longer than ~13 characters long' ), 'missing_attachment' => sprintf( /* translators: %s: URL to media library. */ __( 'That image 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( 'Image Widget (%d)', 'Image Widget (%d)' ), 'media_library_state_single' => __( 'Image Widget' ), ) ); }History
Introduced in 4.8.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 tag, from
src/wp-includes/widgets/class-wp-widget-media-image.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.