wc_attributes_array_filter_visible()WC 3.0.0

Callback for array filter to get visible only.

No Hooks.

Return

true|false.

Usage

wc_attributes_array_filter_visible( $attribute );
$attribute(WC_Product_Attribute) (required)
Attribute data.

Changelog

Since 3.0.0 Introduced.

wc_attributes_array_filter_visible() code WC 8.7.0

function wc_attributes_array_filter_visible( $attribute ) {
	return $attribute && is_a( $attribute, 'WC_Product_Attribute' ) && $attribute->get_visible() && ( ! $attribute->is_taxonomy() || taxonomy_exists( $attribute->get_name() ) );
}