widget_(id_base)_instance_schema
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
widget_(id_base)_instance_schema
widget_(id_base)_instance_schema
wp-includes/widgets/class-wp-widget-media.php 172
$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 );