WC_Template_Loader::unsupported_archive_layered_nav_compatibility( array $query )

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


Description Description


Parameters Parameters

$query

(Required) WP_Query args.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/class-wc-template-loader.php

	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;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.3.4 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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