widget_(id_base)_instance filter-hookWP 4.8.0

Filters the media widget instance prior to rendering the media.

Usage

add_filter( 'widget_(id_base)_instance', 'wp_kama_widget_id_base_instance_filter', 10, 3 );

/**
 * Function for `widget_(id_base)_instance` filter-hook.
 * 
 * @param array           $instance Instance data.
 * @param array           $args     Widget args.
 * @param WP_Widget_Media $widget   Widget object.
 *
 * @return array
 */
function wp_kama_widget_id_base_instance_filter( $instance, $args, $widget ){

	// filter...
	return $instance;
}
$instance(array)
Instance data.
$args(array)
Widget args.
$widget(WP_Widget_Media)
Widget object.

Changelog

Since 4.8.0 Introduced.

Where the hook is called

WP_Widget_Media::widget()
widget_(id_base)_instance
wp-includes/widgets/class-wp-widget-media.php 251
$instance = apply_filters( "widget_{$this->id_base}_instance", $instance, $args, $this );

Where the hook is used in WordPress

Usage not found.