WordPress как на ладони
wordpress jino
фильтр не описан

widget_display_callback хук-фильтр . WP 2.8.0

Filters the settings for a particular widget instance.

Returning false will effectively short-circuit display of the widget.

Использование

add_filter( 'widget_display_callback', 'filter_function_name_8011', 10, 3 );
function filter_function_name_8011( $instance, $this, $args ){
	// filter...

	return $instance;
}
$instance(array)
The current widget instance's settings.
$this(WP_Widget)
The current widget instance.
$args(array)
An array of default widget arguments.

Связи хука

Используется в: WP_Widget::display_callback()

Кусок кода с хуком

Фрагмент из: wp-includes/class-wp-widget.php WP 4.9
...

		if ( array_key_exists( $this->number, $instances ) ) {
			$instance = $instances[ $this->number ];

			/**
			 * Filters the settings for a particular widget instance.
			 *
			 * Returning false will effectively short-circuit display of the widget.
			 *
			 * @since 2.8.0
			 *
			 * @param array     $instance The current widget instance's settings.
			 * @param WP_Widget $this     The current widget instance.
			 * @param array     $args     An array of default widget arguments.
			 */
			$instance = apply_filters( 'widget_display_callback', $instance, $this, $args );

			if ( false === $instance ) {
				return;
			}

			$was_cache_addition_suspended = wp_suspend_cache_addition();
			if ( $this->is_preview() && ! $was_cache_addition_suspended ) {
				wp_suspend_cache_addition( true );
			}

			$this->widget( $args, $instance );

			if ( $this->is_preview() ) {
				wp_suspend_cache_addition( $was_cache_addition_suspended );
			}
...