Astra_Woocommerce::add_active_filter_widget_class( string $block_content, array $block )

Add active filter widget class when “chip” toggle enabled.


Description


Parameters

$block_content

(string) (Required) Rendered block content.

$block

(array) (Required) Block object.


Return

(string) Active filter block content.


Source

File: inc/compatibility/woocommerce/class-astra-woocommerce.php

		public function add_active_filter_widget_class( $block_content, $block ) {

			if ( isset( $block['blockName'] ) && isset( $block['attrs']['displayStyle'] ) && 'chips' === $block['attrs']['displayStyle'] ) {
				$block_content = preg_replace(
					'/' . preg_quote( 'class="', '/' ) . '/',
					'class="ast-woo-active-filter-widget ',
					$block_content,
					1
				);
			}

			return $block_content;
		}

Changelog

Changelog
Version Description
3.9.4 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.