diff --git a/wp-content/themes/dekart/functions.php b/wp-content/themes/dekart/functions.php index 74c3a24..6e9abc7 100644 --- a/wp-content/themes/dekart/functions.php +++ b/wp-content/themes/dekart/functions.php @@ -2690,10 +2690,29 @@ add_filter( 'wpseo_robots', function( $robots ) { return $robots; }, 999 ); - - - wp_send_json_success( array( - 'log' => $log, - 'summary' => $summary, - ) ); +// Закрытие dekart_ajax_flush_cache() } + +/** + * [TODO: удалить после деплоя на production] + * Разовое автосоздание страницы program-pksh. + * На dev страница уже есть, на production — создаётся при первом хитре. + */ +add_action( 'init', function() { + if ( wp_doing_ajax() || is_admin() ) { + return; + } + if ( get_transient( 'dekart_program_pksh_created' ) ) { + return; + } + if ( ! get_page_by_path( 'program-pksh' ) ) { + wp_insert_post( array( + 'post_type' => 'page', + 'post_title' => 'Программа — Подготовка к школе', + 'post_name' => 'program-pksh', + 'post_status' => 'publish', + 'page_template' => 'page-program-pksh.php', + ) ); + } + set_transient( 'dekart_program_pksh_created', 1, DAY_IN_SECONDS ); +} ); diff --git a/wp-content/themes/dekart/template-parts/author-eaat.php b/wp-content/themes/dekart/template-parts/author-eaat.php index a8360ad..b485e46 100644 --- a/wp-content/themes/dekart/template-parts/author-eaat.php +++ b/wp-content/themes/dekart/template-parts/author-eaat.php @@ -3,7 +3,7 @@ * E-E-A-T автор и даты — универсальный шаблон. * * Автор: поле на странице → OG: Site Name → «Частная школа Декарт». - * Годы на рынке: schema_founded (CF) → branch_founded (Settings). + * Годы на рынке: schema_founded (CF) → branch_founded (Settings) → 2014. * Даты: из WordPress (публикация/обновление). * * @package Dekart @@ -19,8 +19,8 @@ $post_id = get_the_ID(); $author_name = carbon_get_post_meta( $post_id, 'pksh_author_name' ) ?: get_option( 'branch_og_site_name', 'Частная школа Декарт' ); -// Годы на рынке: CF → Settings API → пусто -$founded = carbon_get_theme_option( 'schema_founded' ) ?: get_option( 'branch_founded', '' ); +// Годы на рынке: CF → Settings API → hardcoded 2014 +$founded = carbon_get_theme_option( 'schema_founded' ) ?: get_option( 'branch_founded', '2014' ); $years = $founded ? (int) date( 'Y' ) - (int) $founded : 0; $author_title = 'Образовательный центр с гослицензией';