Improves section metadata usage of filter.

This commit is contained in:
mateuswetah 2022-05-10 16:13:10 -03:00
parent 20489230a5
commit 5bdc5230bc
1 changed files with 86 additions and 76 deletions

View File

@ -1,5 +1,14 @@
<?php
/**
* The new metadata sections function makes it a bit more complicated to add
* the thumbnail and share buttons in the middle of the metadata.
* So we have some logic that is only needed if they are set.
* The following uses a filter to add them right above the first metadatum in the first section.
**/
if (
( has_post_thumbnail() && get_theme_mod( 'tainacan_single_item_display_thumbnail', true ) ) ||
( !get_theme_mod('tainacan_single_item_collection_header', false) && get_theme_mod( 'tainacan_single_item_display_share_buttons', true ) )
) {
// Gets collection so we can obtain firtst metadata
$collection = tainacan_get_collection();
@ -94,6 +103,7 @@
}
}
}
}
$metadata_args = array(
'display_slug_as_class' => true,