WC_Widget_Brand_Nav::get_chosen_attributes()publicWC 1.0

Gets the currently selected attributes

Method of the class: WC_Widget_Brand_Nav{}

No Hooks.

Return

Array.

Usage

$WC_Widget_Brand_Nav = new WC_Widget_Brand_Nav();
$WC_Widget_Brand_Nav->get_chosen_attributes();

WC_Widget_Brand_Nav::get_chosen_attributes() code WC 9.5.1

public function get_chosen_attributes() {
	// phpcs:ignore WordPress.Security.NonceVerification.Recommended
	if ( ! empty( $_GET['filter_product_brand'] ) ) {
		$filter_product_brand = wc_clean( wp_unslash( $_GET['filter_product_brand'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
		return array_map( 'intval', explode( ',', $filter_product_brand ) );
	}

	return array();
}