Feature request: hide empty values
-
Might you be persuaded to add a tiny check to your nice little plugin?
In the method WPCAG_Fo::attributes_table all attributes are listed regardless if they have a value or not.
I added a rudimentary check…public static function attributes_table( $product_attributes ) { ob_start(); ?> <table class="woocommerce-product-attributes shop_attributes"> <?php foreach ( $product_attributes as $product_attribute_key => $product_attribute ) { if ( $product_attribute['value'] ) { ?> <tr class="woocommerce-product-attributes-item woocommerce-product-attributes-item--<?php echo esc_attr( $product_attribute_key ); ?>"> <th class="woocommerce-product-attributes-item__label"><?php echo wp_kses_post( $product_attribute['label'] ); ?></th> <td class="woocommerce-product-attributes-item__value"><?php echo wp_kses_post( $product_attribute['value'] ); ?></td> </tr> <?php } } ?> </table> <?php return apply_filters( 'wpcag_attributes_table', ob_get_clean(), $product_attributes ); }
…but seeing that I can’t extend the class and override it, it’s a bit on the volatile side. The real solution would of course be to add an option for this in the plugin itself.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Feature request: hide empty values’ is closed to new replies.