FEATURE Handling numerotation and type terms
This commit is contained in:
parent
9fe976e115
commit
7b4454b8f4
|
|
@ -6,13 +6,15 @@ $current_post_type_supports_type = is_object_in_taxonomy($current_post_type, 'ty
|
||||||
$hasNumerotation = hasPostTypeNumerotation($current_post_type);
|
$hasNumerotation = hasPostTypeNumerotation($current_post_type);
|
||||||
|
|
||||||
if ($current_post_type_supports_type) {
|
if ($current_post_type_supports_type) {
|
||||||
$type = get_the_terms($current_post_id, 'type') ?? null;
|
$type_term = get_the_terms($current_post_id, 'type')[0] ?? null;
|
||||||
|
if ($type_term) {
|
||||||
|
$type = $type_term->name;
|
||||||
|
}
|
||||||
// $current_post_type === 'analyses-etudes' && is_array($type) && !empty($type) && isset($type[0]->name
|
// $current_post_type === 'analyses-etudes' && is_array($type) && !empty($type) && isset($type[0]->name
|
||||||
} else {
|
} else {
|
||||||
$current_post_type_obj = get_post_type_object($current_post_type);
|
$current_post_type_obj = get_post_type_object($current_post_type);
|
||||||
$type = $current_post_type_obj->labels->singular_name;
|
$type = $current_post_type_obj->labels->singular_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -22,9 +24,11 @@ if ($current_post_type_supports_type) {
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($hasNumerotation) : ?>
|
<?php if ($hasNumerotation) : ?>
|
||||||
|
<?php
|
||||||
|
$numerotation = get_post_meta($current_post_id, 'post_numerotation', true); ?>
|
||||||
<p class="content-meta__revue-issue content-meta__revue-issue--green">
|
<p class="content-meta__revue-issue content-meta__revue-issue--green">
|
||||||
<span class="revue-issue-number revue-meta__label sr-only">Numéro</span>
|
<span class="revue-issue-number revue-meta__label sr-only">Numéro</span>
|
||||||
28
|
<?php echo $numerotation; ?>
|
||||||
</p>
|
</p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
Loading…
Reference in New Issue
Block a user