2026-10-12 14:43:32 +00:00

30 lines
1.1 KiB
PHP

<?php
// Лицензия
if (! defined('ABSPATH')) {
exit;
}
$post_id = get_the_ID();
$license_photo = carbon_get_post_meta($post_id, 'pksh_license_photo');
$license_text = carbon_get_post_meta($post_id, 'pksh_license_text') ?: 'Лицензия образовательной организации.';
$license_url = '';
if (! empty($license_photo)) {
$license_id = is_array($license_photo) && isset($license_photo['id']) ? (int) $license_photo['id'] : (int) $license_photo;
$license_url = $license_id ? (string) wp_get_attachment_url($license_id) : '';
}
if ('' === $license_url) {
return;
}
?>
<section class="bento pksh-section" id="pksh-license" aria-label="Лицензия">
<div class="bento__full section-header--left">
<h2 class="bento-h2">Лицензия</h2>
<?php if ('' !== $license_text) : ?><p class="pksh-lead"><?php echo esc_html($license_text); ?></p><?php endif; ?>
<img class="pksh-license__photo" src="<?php echo esc_url($license_url); ?>" alt="Лицензия образовательной организации" loading="lazy" decoding="async">
</div>
</section>