From 8a05f72f787f793f6a7a7f46028df86fe65648fb Mon Sep 17 00:00:00 2001 From: Claudiu Lodromanean Date: Fri, 10 Feb 2017 14:35:26 -0800 Subject: [PATCH] Minor clean-up --- .../data-stores/class-wc-product-variation-data-store-cpt.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/data-stores/class-wc-product-variation-data-store-cpt.php b/includes/data-stores/class-wc-product-variation-data-store-cpt.php index 59fc147f558..9dde44cd3c6 100644 --- a/includes/data-stores/class-wc-product-variation-data-store-cpt.php +++ b/includes/data-stores/class-wc-product-variation-data-store-cpt.php @@ -174,12 +174,13 @@ class WC_Product_Variation_Data_Store_CPT extends WC_Product_Data_Store_CPT impl protected function generate_product_title( $product ) { $include_attribute_names = false; $attributes = (array) $product->get_attributes(); + + //Determine whether to include attribute names through counting the number of one-word attribute values $one_word_attributes = 0; foreach ( $attributes as $name => $value ) { if ( false === strpos( $value, '-' ) ) { ++$one_word_attributes; } - if ( $one_word_attributes > 1 ) { $include_attribute_names = true; break;