2026-10-12 16:37:51 +00:00

71 lines
2.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// Автор, даты и копирайт
if (! defined('ABSPATH')) {
exit;
}
$post_id = get_the_ID();
$args = isset($args) && is_array($args) ? $args : array();
$canon = dekart_author_canon($args);
$author_name = $canon['name'];
$author_creds = trim($canon['creds'] . ($canon['stazh'] !== '' ? ', ' . $canon['stazh'] : ''), ', ');
$publish_date = $post_id ? get_the_date('c', $post_id) : '';
$modified_date = $post_id ? get_the_modified_date('c', $post_id) : '';
$publish_fmt = $publish_date ? date_i18n('j F Y', strtotime($publish_date)) : '';
$modified_fmt = $modified_date ? date_i18n('j F Y', strtotime($modified_date)) : '';
$branch_brand = (string) get_option('branch_og_site_name');
if ('' === trim($branch_brand)) {
$branch_brand = (string) get_option('branch_name');
}
if ('' === trim($branch_brand) && function_exists('carbon_get_theme_option')) {
$branch_brand = (string) carbon_get_theme_option('site_name');
}
$branch_city = function_exists('dekart_branch_city') ? dekart_branch_city() : (string) get_option('branch_city');
if (empty($author_name) && empty($publish_fmt) && empty($modified_fmt)) {
return;
}
?>
<section class="author-info-section section-bg" data-bg="author-info" aria-label="Информация об авторе">
<div class="container">
<div class="author-info__inner">
<div class="author-info__copyright">
<?php
$copyright = '' !== trim($branch_brand) ? $branch_brand : 'Частная школа';
if ('' !== trim($branch_city) && false === mb_stripos($copyright, $branch_city)) {
$copyright .= ', ' . $branch_city;
}
?>
&copy; <?php echo esc_html(date_i18n('Y')); ?> <?php echo esc_html($copyright); ?>.
</div>
<?php if ($author_name) : ?>
<div class="author-info__author">
<span class="author-info__label">Автор контента:</span>
<span class="author-info__name"><?php echo esc_html($author_name); ?></span>
<?php if ($author_creds) : ?>
<span class="author-info__creds">— <?php echo esc_html($author_creds); ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="author-info__dates">
<?php if ($publish_fmt) : ?>
<span>Дата публикации: <?php echo esc_html($publish_fmt); ?></span>
<?php endif; ?>
<?php if ($modified_fmt) : ?>
<span>Дата обновления: <?php echo esc_html($modified_fmt); ?></span>
<?php endif; ?>
</div>
</div>
</div>
</section>