From 9543af56451156b542cbfb06a76e6ba1a90081c1 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Thu, 21 Mar 2024 12:03:24 -0300 Subject: [PATCH] Creates filters for tweaking child metadata html wrappers. --- .../compound/class-tainacan-compound.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/views/admin/components/metadata-types/compound/class-tainacan-compound.php b/src/views/admin/components/metadata-types/compound/class-tainacan-compound.php index b64e70e93..828300c1e 100644 --- a/src/views/admin/components/metadata-types/compound/class-tainacan-compound.php +++ b/src/views/admin/components/metadata-types/compound/class-tainacan-compound.php @@ -260,16 +260,22 @@ class Compound extends Metadata_Type { private function get_meta_html(Item_Metadata_Entity $meta) { $html = ''; + if ($meta instanceof Item_Metadata_Entity && !empty($meta->get_value_as_html())) { ob_start(); ?>
-

- get_metadatum()->get_name()); ?> -

-

- get_value_as_html()); ?> -

+ get_metadatum()->get_name(); + $child_label_before = apply_filters('tainacan-get-child-item-metadatum-as-html-before-label', '

', $meta); + $child_label_after = apply_filters('tainacan-get-child-item-metadatum-as-html-after-label', '

', $meta); + echo $child_label_before . esc_html($child_label) . $child_label_after; + + $child_value = $meta->get_value_as_html(); + $child_value_before = apply_filters('tainacan-get-child-item-metadatum-as-html-before-value', '

', $meta); + $child_value_after = apply_filters('tainacan-get-child-item-metadatum-as-html-after-value', '

', $meta); + echo $child_value_before . wp_kses_tainacan($child_value) . $child_value_after; + ?>