get_name(); if ( $product instanceof WC_Product_Variation && false === $exclude_variable_attribute ) { $name .= ' - ' . $product->get_attribute_summary(); } $product_names[] = wp_strip_all_tags( $name ); } } else { foreach ( $products as $product ) { if ( ! $product instanceof WC_Product ) { continue; } $name = $product->get_name(); if ( $product instanceof WC_Product_Variation && false === $exclude_variable_attribute ) { $name .= ' - ' . $product->get_attribute_summary(); } $product_names[] = wp_strip_all_tags( $name ); } } $explode_operator = apply_filters( 'bwfan_product_name_separator', ', ' ); echo implode( $explode_operator, $product_names ); //phpcs:ignore WordPress.Security.EscapeOutput