WPDev.one
Core Class

WP_Widget_Media

class WP_Widget_Media // Constructor: function Object() { [native code] }

Core class that implements a media widget.

Methods 17 methods

Method / Return Description
__construct()
void

Constructor.

Parameters: $id_base: mixed, $name: mixed, $widget_options: mixed, $control_options: mixed
_register_one()
void

Add hooks while registering all widget instances of this widget class.

Parameters: $number: mixed
get_instance_schema()
array

Get schema for properties of a widget instance (item).

is_attachment_with_mime_type()
bool

Determine if the supplied attachment is for a valid attachment post with the specified MIME type.

Parameters: $attachment: mixed, $mime_type: mixed
sanitize_token_list()
string

Sanitize a token list string, such as used in HTML rel and class attributes.

Parameters: $tokens: mixed
widget()
void

Displays the widget on the front-end.

Parameters: $args: mixed, $instance: mixed
update()
array

Sanitizes the widget form values as they are saved.

Parameters: $new_instance: mixed, $old_instance: mixed
render_media()
void

Render the media on the frontend.

Parameters: $instance: mixed
form()
void

Outputs the settings update form.

Parameters: $instance: mixed
display_media_state()
array

Filters the default media display states for items in the Media list table.

Parameters: $states: mixed, $post: mixed
enqueue_preview_scripts()
void

Enqueue preview scripts.

enqueue_admin_scripts()
void

Loads the required scripts and styles for the widget control.

render_control_template_scripts()
void

Render form template scripts.

reset_default_labels()
void

Resets the cache for the default labels.

has_content()
bool

Whether the widget has content to show.

Parameters: $instance: mixed
get_default_description()
string

Returns the default description of the widget.

get_l10n_defaults()
(string

Returns the default localized strings used by the widget.

Properties

Property / Type Description
$l10n
mixed
public
No description available.
$registered
mixed
public
No description available.
$default_description
mixed
public
No description available.
$l10n_defaults
mixed
public
No description available.

Class Information

Since Version
4.8.0
Source File
wp-includes/widgets/class-wp-widget-media.php
Advertisement