Title: WP_Widget_Media_Video::__construct
Published: June 15, 2017
Last modified: February 24, 2026

---

# WP_Widget_Media_Video::__construct()

## In this article

 * [Source](https://developer.wordpress.org/reference/classes/wp_widget_media_video/__construct/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_widget_media_video/__construct/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_widget_media_video/__construct/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_widget_media_video/__construct/?output_format=md#wp--skip-link--target)

Constructor.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_widget_media_video/__construct/?output_format=md#source)󠁿

    ```php
    public function __construct() {
    	parent::__construct(
    		'media_video',
    		__( 'Video' ),
    		array(
    			'description' => __( 'Displays a video from the media library or from YouTube, Vimeo, or another provider.' ),
    			'mime_type'   => 'video',
    		)
    	);

    	$this->l10n = array_merge(
    		$this->l10n,
    		array(
    			'no_media_selected'          => __( 'No video selected' ),
    			'add_media'                  => _x( 'Add Video', 'label for button in the video widget' ),
    			'replace_media'              => _x( 'Replace Video', 'label for button in the video widget; should preferably not be longer than ~13 characters long' ),
    			'edit_media'                 => _x( 'Edit Video', 'label for button in the video widget; should preferably not be longer than ~13 characters long' ),
    			'missing_attachment'         => sprintf(
    				/* translators: %s: URL to media library. */
    				__( 'That video 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( 'Video Widget (%d)', 'Video Widget (%d)' ),
    			'media_library_state_single' => __( 'Video Widget' ),
    			/* translators: %s: A list of valid video file extensions. */
    			'unsupported_file_type'      => sprintf( __( 'Sorry, the video at the supplied URL cannot be loaded. Please check that the URL is for a supported video file (%s) or stream (e.g. YouTube and Vimeo).' ), '<code>.' . implode( '</code>, <code>.', wp_get_video_extensions() ) . '</code>' ),
    		)
    	);
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-media-video.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/widgets/class-wp-widget-media-video.php#L25)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/widgets/class-wp-widget-media-video.php#L25-L54)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_widget_media_video/__construct/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Widget_Media::__construct()](https://developer.wordpress.org/reference/classes/wp_widget_media/__construct/)`wp-includes/widgets/class-wp-widget-media.php` |

Constructor.

  | 
| [_n_noop()](https://developer.wordpress.org/reference/functions/_n_noop/)`wp-includes/l10n.php` |

Registers plural strings in POT file, but does not translate them.

  | 
| [wp_get_video_extensions()](https://developer.wordpress.org/reference/functions/wp_get_video_extensions/)`wp-includes/media.php` |

Returns a filtered list of supported video formats.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  | 
| [esc_url()](https://developer.wordpress.org/reference/functions/esc_url/)`wp-includes/formatting.php` |

Checks and cleans a URL.

  | 
| [admin_url()](https://developer.wordpress.org/reference/functions/admin_url/)`wp-includes/link-template.php` |

Retrieves the URL to the admin area for the current site.

  |

[Show 4 more](https://developer.wordpress.org/reference/classes/wp_widget_media_video/__construct/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_widget_media_video/__construct/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_widget_media_video/__construct/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_widget_media_video%2F__construct%2F)
before being able to contribute a note or feedback.