Minor clean-up

This commit is contained in:
Claudiu Lodromanean 2017-02-10 14:35:26 -08:00
parent f362e0108e
commit 8a05f72f78
1 changed files with 2 additions and 1 deletions

View File

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