taxonomy); if(!($taxonomy instanceof \WP_Taxonomy)) { return $templates; } $is_product = in_array(Product::POST_TYPE, $taxonomy->object_type); if(!$is_product) { return $templates; } array_push($templates, self::PRODUCT_ARCHIVE_TEMPLATE); return $templates; } }