widget_(id_base)_instance
Filters the media widget instance prior to rendering the media.
Использование
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(массив)
- Instance data.
- $args(массив)
- Widget args.
- $widget(WP_Widget_Media)
- Widget object.
Список изменений
С версии 4.8.0 | Введена. |
Где вызывается хук
widget_(id_base)_instance
wp-includes/widgets/class-wp-widget-media.php 255
$instance = apply_filters( "widget_{$this->id_base}_instance", $instance, $args, $this );