Fixes non-multiple compound metadata not surrounded by 'tainacan-compound-group'

This commit is contained in:
mateuswetah 2020-04-23 13:49:54 -03:00
parent 4bba4f2a5d
commit f88574b90e
1 changed files with 15 additions and 14 deletions

View File

@ -189,23 +189,24 @@ class Compound extends Metadata_Type {
} }
} else { } else {
$return .= '<div class="tainacan-compound-group">';
foreach ( $value as $meta ) {
foreach ( $value as $meta ) {
if ( $meta->get_value_as_html() != '' ) { if ( $meta->get_value_as_html() != '' ) {
$return .= '<div class="tainacan-metadatum">'; $return .= '<div class="tainacan-metadatum">';
if ( $meta instanceof Item_Metadata_Entity ) {
$return .= '<label class="label">' . $meta->get_metadatum()->get_name() . "</label>\n";
$return .= '<p>' . $meta->get_value_as_html() . '</p>';
}
$return .= '</div>' . "\n\n";
}
if ( $meta instanceof Item_Metadata_Entity ) { }
$return .= '<label class="label">' . $meta->get_metadatum()->get_name() . "</label>\n"; $return .= '</div>' . "\n\n";
$return .= '<p>' . $meta->get_value_as_html() . '</p>';
}
$return .= '</div>' . "\n\n";
}
}
} }
return $return; return $return;