WP_Widget_Media
- Since
- 4.8.0
- Source
wp-includes/widgets/class-wp-widget-media.php:17
Core class that implements a media widget.
Compatibility
- WordPress
- since 4.8.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 3
Every hook that fires from inside WP_Widget_Media, in the order it appears in the class, grouped by the method that fires it.
WP_Widget_Media::get_instance_schema()
- apply_filters( widget_{$this->id_base}_instance_schema )filter line 172
WP_Widget_Media::widget()
- apply_filters( widget_title )filter line 240
- apply_filters( widget_{$this->id_base}_instance )filter line 255
Properties · 4
$l10narraypublic- Translation labels.
$registeredboolprotected- Whether or not the widget has been registered yet.
$default_descriptionstringprotected static- The default widget description.
$l10n_defaultsstring[]protected static- The default localized strings used by the widget.
Methods · 17
- __construct()Constructor.
- _register_one()Add hooks while registering all widget instances of this widget class.
- get_instance_schema()Get schema for properties of a widget instance (item).
- is_attachment_with_mime_type()Determine if the supplied attachment is for a valid attachment post with the specified MIME type.
- sanitize_token_list()Sanitize a token list string, such as used in HTML rel and class attributes.
- widget()Displays the widget on the front-end.
- update()Sanitizes the widget form values as they are saved.
- render_media()Render the media on the frontend.
- form()Outputs the settings update form.
- display_media_state()Filters the default media display states for items in the Media list table.
- enqueue_preview_scripts()Enqueue preview scripts.
- enqueue_admin_scripts()Loads the required scripts and styles for the widget control.
- render_control_template_scripts()Render form template scripts.
- reset_default_labels()Resets the cache for the default labels.
- has_content()Whether the widget has content to show.
- get_default_description()Returns the default description of the widget.
- get_l10n_defaults()Returns the default localized strings used by the widget.
Changelog
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.1.0 tag, from
src/wp-includes/widgets/class-wp-widget-media.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.