widget_display_callback
Filters the settings for a particular widget instance.
Returning false will effectively short-circuit display of the widget.
Использование
add_filter( 'widget_display_callback', 'wp_kama_widget_display_callback_filter', 10, 3 ); /** * Function for `widget_display_callback` filter-hook. * * @param array $instance The current widget instance's settings. * @param WP_Widget $widget The current widget instance. * @param array $args An array of default widget arguments. * * @return array */ function wp_kama_widget_display_callback_filter( $instance, $widget, $args ){ // filter... return $instance; }
- $instance(массив)
- The current widget instance's settings.
- $widget(WP_Widget)
- The current widget instance.
- $args(массив)
- An array of default widget arguments.
Список изменений
С версии 2.8.0 | Введена. |
Где вызывается хук
widget_display_callback
widget_display_callback
wp-includes/class-wp-widget.php 383
$instance = apply_filters( 'widget_display_callback', $instance, $this, $args );
wp-includes/widgets.php 1251
$instance = apply_filters( 'widget_display_callback', $instance, $widget_obj, $args );