Automattic\WooCommerce\Blocks\BlockTypes

ProductFilters::get_overlay_mode │ private │ WC 1.0

Resolve the canonical overlay mode with legacy drawer compatibility.

Метод класса: ProductFilters{}

Хуков нет.

Возвращает

string. Overlay mode.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_overlay_mode( $attributes );
$attributes(массив) (обязательный)
Block attributes.

Код ProductFilters::get_overlay_mode() WC 11.2.1

private function get_overlay_mode( $attributes ) {
	$overlay_mode = $attributes['overlayMode'] ?? null;
	if ( in_array( $overlay_mode, array( 'off', 'mobile', 'always' ), true ) ) {
		return $overlay_mode;
	}

	return isset( $attributes['showFilterDrawer'] ) && false === $attributes['showFilterDrawer'] ? 'off' : 'mobile';
}