widget_(id_base)_instance_schema filter-hookWP 4.9.0

Filters the media widget instance schema to add additional properties.

Usage

add_filter( 'widget_(id_base)_instance_schema', 'wp_kama_widget_id_base_instance_schema_filter', 10, 2 );

/**
 * Function for `widget_(id_base)_instance_schema` filter-hook.
 * 
 * @param array           $schema Instance schema.
 * @param WP_Widget_Media $widget Widget object.
 *
 * @return array
 */
function wp_kama_widget_id_base_instance_schema_filter( $schema, $widget ){

	// filter...
	return $schema;
}
$schema(array)
Instance schema.
$widget(WP_Widget_Media)
Widget object.

Changelog

Since 4.9.0 Introduced.

Where the hook is called

WP_Widget_Media::get_instance_schema()
widget_(id_base)_instance_schema
WP_Widget_Media_Gallery::get_instance_schema()
widget_(id_base)_instance_schema
wp-includes/widgets/class-wp-widget-media.php 168
$schema = apply_filters( "widget_{$this->id_base}_instance_schema", $schema, $this );
wp-includes/widgets/class-wp-widget-media-gallery.php 101
$schema = apply_filters( "widget_{$this->id_base}_instance_schema", $schema, $this );

Where the hook is used in WordPress

Usage not found.