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.
{} Это метод класса: WC_Template_Loader{}
Хуков нет.
Возвращает
Массив.
Использование
$result = WC_Template_Loader::unsupported_archive_layered_nav_compatibility( $query );
- $query(массив) (обязательный)
- WP_Query args.
Список изменений
С версии 3.3.4 | Введена. |
Код WC_Template_Loader::unsupported_archive_layered_nav_compatibility() WC Template Loader::unsupported archive layered nav compatibility WC 5.0.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;
}