feat(blog): CF alias keys for FAQ/sources; remove header cabinet link
This commit is contained in:
parent
9915449dfb
commit
84b460c6bd
@ -1966,14 +1966,14 @@ function add_carbon()
|
||||
->set_help_text('Короткая суть статьи 2–3 предложения. Выводится сразу под заголовком и в разметке. Пусто — берётся лид записи.'),
|
||||
Field::make('complex', 'post_faq', 'FAQ статьи')
|
||||
->set_layout('tabbed-horizontal')
|
||||
->set_help_text('Вопросы и ответы → блок FAQ + разметка FAQPage.')
|
||||
->set_help_text('Вопросы и ответы → блок FAQ + разметка FAQPage. Ключи подполей: faq_q / faq_a (принимаются также question / answer).')
|
||||
->add_fields(array(
|
||||
Field::make('text', 'faq_q', 'Вопрос')->set_width(40),
|
||||
Field::make('textarea', 'faq_a', 'Ответ')->set_width(60),
|
||||
)),
|
||||
Field::make('complex', 'post_sources', 'Источники')
|
||||
->set_layout('tabbed-horizontal')
|
||||
->set_help_text('Ссылки на источники/исследования → блок «Источники».')
|
||||
->set_help_text('Ссылки на источники/исследования → блок «Источники». Ключи подполей: source_title / source_url (принимаются также name / link).')
|
||||
->add_fields(array(
|
||||
Field::make('text', 'source_title', 'Название')->set_width(55),
|
||||
Field::make('text', 'source_url', 'Ссылка')->set_width(45),
|
||||
@ -5972,10 +5972,20 @@ function dekart_cf_rows(int $post_id, string $field, array $order): array
|
||||
$lookup = array();
|
||||
|
||||
foreach ($order as $i => $key) {
|
||||
$lookup[ strtolower((string) $key) ] = $key;
|
||||
$lookup[ (string) $i ] = $key;
|
||||
$lookup[ strtolower((string) $key) ] = $key;
|
||||
$lookup[ (string) $i ] = $key;
|
||||
}
|
||||
|
||||
$syn = array(
|
||||
'question' => 'q', 'answer' => 'a', 'q' => 'q', 'a' => 'a',
|
||||
'faq_q' => 'q', 'faq_a' => 'a',
|
||||
'name' => 'name', 'platform_name' => 'name',
|
||||
'title' => 'title', 'source_title' => 'title',
|
||||
'url' => 'url', 'link' => 'url', 'source_url' => 'url', 'platform_url' => 'url',
|
||||
'icon' => 'icon', 'platform_icon' => 'icon',
|
||||
'rating' => 'rating', 'platform_rating' => 'rating',
|
||||
);
|
||||
|
||||
foreach ($rows as $r) {
|
||||
$parts = explode('|', (string) $r->meta_key);
|
||||
array_shift($parts);
|
||||
@ -6012,8 +6022,12 @@ function dekart_cf_rows(int $post_id, string $field, array $order): array
|
||||
$key = $lookup[ $short ];
|
||||
break;
|
||||
}
|
||||
if (ctype_digit($seg) && isset($lookup[ $seg ])) {
|
||||
$key = $lookup[ $seg ];
|
||||
if (isset($syn[ $short ]) && isset($lookup[ $syn[ $short ] ])) {
|
||||
$key = $lookup[ $syn[ $short ] ];
|
||||
break;
|
||||
}
|
||||
if (isset($syn[ $seg ]) && isset($lookup[ $syn[ $seg ] ])) {
|
||||
$key = $lookup[ $syn[ $seg ] ];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,12 +133,6 @@ if (file_exists($fonts_css)) {
|
||||
href="tel:<?php echo preg_replace('/[^0-9+]/', '', $header_phone); ?>">
|
||||
<span class="header-phone-mobile__text"><?php echo esc_html($header_phone); ?></span>
|
||||
</a>
|
||||
<a href="<?php echo esc_url(carbon_get_theme_option('site_lk_url') ?: 'https://lk.dekart-school.ru/'); ?>" target="_blank" rel="noopener noreferrer"
|
||||
aria-label="Личный кабинет">
|
||||
<img width="18" height="18"
|
||||
src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/icon-user-w.svg"
|
||||
alt="" loading="lazy">
|
||||
</a>
|
||||
<button class="burger-btn"
|
||||
aria-label="<?php esc_attr_e('Открыть меню', 'dekart'); ?>"
|
||||
aria-expanded="false"
|
||||
@ -159,10 +153,6 @@ if (file_exists($fonts_css)) {
|
||||
<span><?php echo esc_html(carbon_get_theme_option('site_phone')); ?></span>
|
||||
</a>
|
||||
<div class="add-menu__cta">
|
||||
<a class="header-lk" href="<?php echo esc_url(carbon_get_theme_option('site_lk_url') ?: 'https://lk.dekart-school.ru/'); ?>" target="_blank" rel="noopener noreferrer" aria-label="<?php esc_attr_e('Личный кабинет', 'dekart'); ?>">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
|
||||
<span><?php esc_html_e('Кабинет', 'dekart'); ?></span>
|
||||
</a>
|
||||
<button class="btn-free-lesson-header btn-primary desktop btn-write">
|
||||
<?php esc_html_e('Записаться на экскурсию', 'dekart'); ?>
|
||||
</button>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user