30 lines
1.0 KiB
PHP
30 lines
1.0 KiB
PHP
<?php
|
|
$current_post_id = $args['current_post_id'] ?? get_the_ID();
|
|
$current_post_type = $args['current_post_type'] ?? null;
|
|
$type = null;
|
|
$current_post_type_supports_type = is_object_in_taxonomy($current_post_type, 'type');
|
|
$hasNumerotation = hasPostTypeNumerotation($current_post_type);
|
|
|
|
if ($current_post_type_supports_type) {
|
|
$type = get_the_terms($current_post_id, 'type') ?? null;
|
|
// $current_post_type === 'analyses-etudes' && is_array($type) && !empty($type) && isset($type[0]->name
|
|
} else {
|
|
$current_post_type_obj = get_post_type_object($current_post_type);
|
|
$type = $current_post_type_obj->labels->singular_name;
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
<div class="content-meta">
|
|
<?php if ($type) : ?>
|
|
<span class="content-meta__type content-meta__type--<?php echo $current_post_type ?>"><?php echo $type ?></span>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($hasNumerotation) : ?>
|
|
<p class="content-meta__revue-issue content-meta__revue-issue--green">
|
|
<span class="revue-issue-number revue-meta__label sr-only">Numéro</span>
|
|
28
|
|
</p>
|
|
<?php endif; ?>
|
|
</div>
|