1900) { $tenure = max(0, (int) $current_year - (int) $start_year); } $t_desc = trim((string) carbon_get_post_meta($tid, 'teacher_description')); $rating_num = (float) $rating; $teacher_rc = isset($teacher_review_counts[ $tid ]) ? (int) $teacher_review_counts[ $tid ] : 0; // alt: ФИО + предмет + город $alt_photo = implode(', ', array_filter(array( $full_name, $direction, $city ))); $rc_word = ''; if ($teacher_rc > 0) { $rc_mod10 = $teacher_rc % 10; $rc_mod100 = $teacher_rc % 100; if ($rc_mod10 === 1 && $rc_mod100 !== 11) { $rc_word = 'отзыв'; } elseif ($rc_mod10 >= 2 && $rc_mod10 <= 4 && ( $rc_mod100 < 12 || $rc_mod100 > 14 )) { $rc_word = 'отзыва'; } else { $rc_word = 'отзывов'; } } // Анкор ссылки: предмет + город $link_anchor = trim((string) $direction . ( $city ? ' в ' . $city : '' )); if ('' === $link_anchor) { $link_anchor = 'Подробнее о преподавателе'; } // Направления: из CF-карты страницы, иначе — категория преподавателя (trainingCategory) $dir_slugs = array(); if (! empty($map_dirs['by_teacher'][ $tid ])) { $dir_slugs = $map_dirs['by_teacher'][ $tid ]; } elseif (! empty($cat)) { $dir_slugs = array($cat); } else { $terms = wp_get_post_terms($tid, 'trainingCategory', array('fields' => 'slugs')); if (! is_wp_error($terms)) { $dir_slugs = $terms; } } $dir_slugs = array_values(array_unique(array_filter(array_map('sanitize_title', (array) $dir_slugs)))); $cat_filter = implode(' ', $dir_slugs); ?>
<?php echo esc_attr($alt_photo); ?>

0 || $teacher_rc > 0) : ?>
Стаж: лет 0) : ?> 0) : ?>