fix `get_value_as_html` for empty date

This commit is contained in:
vnmedeiros 2020-05-05 16:56:04 -03:00
parent 04ea9d5949
commit a54cad7611
1 changed files with 4 additions and 0 deletions

View File

@ -77,6 +77,8 @@ class Date extends Metadata_Type {
$suffix = $item_metadata->get_multivalue_suffix();
$separator = $item_metadata->get_multivalue_separator();
foreach ( $value as $el ) {
if( empty( $el ) )
continue;
$return .= $prefix;
$return .= mysql2date(get_option('date_format'), ($el));
$return .= $suffix;
@ -85,6 +87,8 @@ class Date extends Metadata_Type {
$return .= $separator;
}
} else {
if( empty( $value ) )
return "";
$return = mysql2date(get_option('date_format'), ($value));
}
return $return;