Update class-wc-emails.php

Check for a value against each meta item before outputting.
This commit is contained in:
Christian Thomas 2014-04-15 16:01:20 +01:00 committed by Mike Jolley
parent e4a959e397
commit ede8bc1a2a
1 changed files with 10 additions and 4 deletions

View File

@ -300,13 +300,19 @@ class WC_Emails {
if ( $plain_text ) {
foreach ( $meta as $key => $value )
echo $key . ': ' . $value . "\n";
foreach ( $meta as $key => $value ) {
if ( $value ) {
echo $key . ': ' . $value . "\n";
}
}
} else {
foreach ( $meta as $key => $value )
echo '<p><strong>' . $key . ':</strong> ' . $value . '</p>';
foreach ( $meta as $key => $value ) {
if ( $value ) {
echo '<p><strong>' . $key . ':</strong> ' . $value . '</p>';
}
}
}
}
}