WordPress at Your Fingertips
function is not described

WC_Template_Loader::unsupported_archive_layered_nav_compatibility() public WC 3.3.4

Add layered nav args to WP_Query args generated by the 'products' shortcode.

{} It's a method of the class: WC_Template_Loader{}

No Hooks.

Return

Array.

Usage

$result = WC_Template_Loader::unsupported_archive_layered_nav_compatibility( $query );
$query(array) (required)
WP_Query args.

Changelog

Since 3.3.4 Introduced.

Code of WC_Template_Loader::unsupported_archive_layered_nav_compatibility() WC 5.6.0

public static function unsupported_archive_layered_nav_compatibility( $query ) {
	foreach ( WC()->query->get_layered_nav_chosen_attributes() as $taxonomy => $data ) {
		$query['tax_query'][] = array(
			'taxonomy'         => $taxonomy,
			'field'            => 'slug',
			'terms'            => $data['terms'],
			'operator'         => 'and' === $data['query_type'] ? 'AND' : 'IN',
			'include_children' => false,
		);
	}
	return $query;
}