Sorry for the long response. Please try to use following code snippet:
class AWL_Show_Only_Once {
public $data = array();
function __construct() {
add_filter( 'awl_show_label_for_product', array( $this, 'awl_show_label_for_product' ), 10, 3 );
}
public function awl_show_label_for_product( $match_condition, $product, $label_id ) {
if ( isset( $this->data[$label_id] ) && $this->data[$label_id] ) {
$match_condition = false;
}
if ( $match_condition && is_singular('product') ) {
$this->data[$label_id] = true;
}
return $match_condition;
}
}
new AWL_Show_Only_Once();