Products > Attributes */ $attrs = array( 'color', 'size', ); if ( 'insert' == $action ) { return $value; } foreach ( $attrs as $attr ) { $name = ( substr( $attr, 0, 3 ) === 'pa_' ) ? $attr : 'pa_' . $attr; if ( $name == $attribute ) { $value = wc_get_product_terms( $post['ID'], $name, array( 'fields' => 'names' ) ); $value = implode( WC_DELIMITER, $value ); } } return $value; }