Опис
Converts Cyrillic characters in post, page, and term slugs to Latin characters. Useful for creating human-readable URLs.
Особливості
- The only plugin with a fully editable transliteration table. Allows adding/removing and editing pairs like ‘Я’ => ‘Ya’, or even ‘Пиво’ => ‘Beer’
- Converts any number of existing post, page, and term slugs in background processes
- Зберігає цілісність постійних посилань вже існуючих записів і сторінок
- Виконує транслітерацію назв файлів з вкладень
- Плагін підтримує російські, білоруські, українські, болгарські, македонські, сербські, грецькі, вірменські, грузинські, казахські, іврит і китайські ієрогліфи
- Має багато переваг перед аналогічними плагінами
- Офіційно сумісний із WPML
Засновано на оригінальному плагіні Rus-To-Lat від Антона Скоробогатова.
Спонсор: Blackfire.
Підтримка плагіна
Скріншоти
Встановлення
- Upload the
cyr2latfolder to the/wp-content/plugins/directory. - Активуйте плагін на сторінці «Плагіни» в панелі управління WordPress.
Часті питання
-
Як призначити свої правила для заміни?
-
Додайте наступний код в
functions.phpфайл вашої теми:/** * Modify conversion table. * * @param array $table Conversion table. * * @return array */ function my_ctl_table( $table ) { $table['Ъ'] = 'U'; $table['ъ'] = 'u'; return $table; } add_filter( 'ctl_table', 'my_ctl_table' ); -
Як я можу перевизначити нестандартну локаль?
-
Наприклад, якщо нестандартна мова є uk_UA, її можна перевизначити як
ukдодавши наступний код до файлу темиfunction.php:/** * Use non-standard locale. * * @param string $locale Current locale. * * @return string */ function my_ctl_locale( $locale ) { if ( 'uk_UA' === $locale ) { return 'uk'; } return $locale; } add_filter( 'ctl_locale', 'my_ctl_locale' ); -
Як я можу визначити власну транслітерацію назв?
-
Додайте подібний код до файлу
functions.phpвашої теми:/** * Filter title before sanitizing. * * @param string|false $result Sanitized title. * @param string $title Title. * * @return string|false */ function my_ctl_pre_sanitize_title( $result, $title ) { if ( 'пиво' === $title ) { return 'beer'; } return $result; } add_filter( 'ctl_pre_sanitize_title', 10, 2 ); -
Як визначити власну транслітерацію назв файлів?
-
Додайте подібний код до файлу
functions.phpвашої теми:/** * Filter filename before sanitizing. * * @param string|false $result Sanitized filename. * @param string $filename Title. * * @return string|false */ function my_ctl_pre_sanitize_filename( $result, $filename ) { if ( 'пиво' === $filename ) { return 'beer'; } return $result; } add_filter( 'ctl_pre_sanitize_filename', 10, 2 ); -
Як я можу дозволити плагіну працювати на зовнішній частині сайту?
-
Додайте наступний код до основного файлу плагіна (або плагіна mu). Цей код не працюватиме, якщо його буде додано до файлу functions.php теми.
/** * Filter status allowed Cyr To Lat plugin to work. * * @param bool $allowed * * @return bool */ function my_ctl_allow( bool $allowed ): bool { $uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_url( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; if ( 0 === strpos( $uri, '/divi-comments' ) ) { return true; } return $allowed; } add_filter( 'ctl_allow', 'my_ctl_allow' ); -
How can I limit post types for background conversion?
-
Додайте подібний код до файлу
functions.phpвашої теми:/** * Filter post types allowed for background conversion. * * @param array $post_types Allowed post types. * * @return array */ function my_ctl_post_types( $post_types ) { return [ 'post' => 'post', 'page' => 'page', 'attachment' => 'attachment', 'product' => 'product', 'nav_menu_item' => 'nav_menu_item', ]; } add_filter( 'ctl_post_types', 'my_ctl_post_types' ); -
Як конвертувати багато постів/термінів за допомогою wp-cli?
-
Скористайтеся наступною командою в консолі:
wp cyr2lat regenerate [--post_type=<post_type>] [--post_status=<post_status>]Where
-post_type is a list of post types,
-post_status is a list of post statuses. -
Як я можу безпечно регенерувати мініатюри?
-
Регенерація мініатюр командою
wp media regenerateможе призвести до розриву посилань у старих публікаціях, оскільки імена файлів транслітеруються.To avoid it, deactivate the cyr2lat plugin during regeneration:
wp media regenerate --skip-plugins=cyr2lat -
Чи можу я внести свій внесок?
-
Так, ви можете!
- Приєднуйтесь до нашого репозитарію GitHub
- Приєднуйтеся до нашої групи Telegram
-
Where do I report security bugs found in this plugin?
-
Please report security vulnerabilities by email to:
security@kagg.eu
When reporting a vulnerability, please include as much information as possible to help us reproduce and investigate the issue, such as:
- A clear description of the vulnerability
- Steps to reproduce
- Proof-of-concept or exploit code (if available)
- Affected versions
We will review your report and respond as quickly as possible.
Відгуки
Учасники та розробники
“Cyr-To-Lat” — проект з відкритим вихідним кодом. В розвиток плагіну внесли свій вклад наступні учасники:
Учасники“Cyr-To-Lat” було перекладено на 10 локалізацій. Дякуємо перекладачам за їх роботу.
Перекладіть “Cyr-To-Lat” на вашу мову.
Цікавитесь розробкою?
Перегляньте код, перегляньте сховище SVN або підпишіться на журнал розробки за допомогою RSS.
Журнал змін
6.7.0 (01.04.2026)
- The minimum required PHP version is now 7.4.
- The minimum required WordPress version is now 6.0.
- Fixed a fatal error occurred with WP-CLI in a rare case.
- Fixed transliteration of WC local attributes.
- Tested with WordPress 7.0.
6.6.0 (30.11.2025)
- Fixed the deprecated function message in Main.php with WordPress 6.9.
- Перевірено на PHP 8.4.
- Tested with WordPress 6.9.
- Tested with WooCommerce 10.3.
6.5.0 (24.10.2025)
- Fixed transliteration of tags during editing.
6.4.1 (03.05.2025)
- Fixed the layout of messages on the Tables page.
- Tested with WordPress 6.8.
- Tested with WooCommerce 9.8.
6.3.0 (22.12.2024)
- Added a warning message on the Tables page when the active table does not match the site locale.
- Видалено виправлення для перекладу після WordPress 6.5+ через проблеми з продуктивністю.
6.2.3 (24.11.2024)
- Виправлена помилка версії PHP 8.4.
- Перевірено на PHP 8.4.
6.2.2 (15.11.2024)
- Виправлено помилку “_load_textdomain_just_in_time” WordPress 6.7.
- Деякі переклади були порожніми в WordPress 6.5+.
6.2.1 (13.11.2024)
- Fixed layout of the Converter page.
- Fixed issues reported by Plugin Check Plugin.
6.2.0 (13.11.2024)
- Припинено підтримку PHP 7.0 та 7.1. Мінімально необхідна версія PHP тепер 7.2.
- Мінімально необхідна версія WordPress – 5.3.
- Fixed the notice about the _load_textdomain_just_in_time function being called incorrectly.
- Протестовано з WordPress 6.7.
- Перевірено на WooCommerce 9.4.
6.1.0 (09.03.2024)
- Протестовано з WordPress 6.5.
- Перевірено на WooCommerce 8.6.
- Fixed error on the System Info tab when post types or post statuses are not set.
6.0.8 (14.02.2024)
- Покращене розпізнавання редактора Gutenberg.
- Виправлено обробку атрибутів товару.
6.0.7 (11.02.2024)
- Перевірено на WooCommerce 8.5.
- Added redirect from the cyrillic post title when creating a new post.
- Added description of post types and post statuses on the Converter page.
- Виправлено відображення всіх описів файлів у редакторі тем у поточній локалі.
- Fixed PHP warning in the SettingsBase.
- Fixed the output of variable product attributes.
6.0.6 (14.01.2024)
- Протестовано з WordPress 6.4.
- Перевірено на WooCommerce 8.4.
- Перевірено на PHP 8.3.
- Виправлена документація щодо фільтра ctl_allow.
- Fixed the improper display of the “rate plugin” message on options.php.
6.0.5 (09.10.2023)
- Fixed displaying file descriptions in the Theme Editor; now in the current locale.
6.0.4 (23.09.2023)
- Fixed disappeared file descriptions on the Theme File Editor page.
6.0.3 (29.07.2023)
- Fixed the fatal error with Jetpack sync.
6.0.2 (26.07.2023)
- Fixed fatal error in admin_footer_text().
6.0.1 (26.07.2023)
- Fixed the fatal error on the System Info page with empty options.
6.0.0 (26.07.2023)
- Припинено підтримку PHP 5.6. Мінімальна необхідна версія PHP зараз становить 7.0.
- Протестовано з WordPress 6.3.
- Перевірено на WooCommerce 7.9
- Додана вкладка «Інформація про систему».
- Додано фільтр “ctl_allow”
- Fixed console error when saving table data.
- Fixed the current table setting on the Tables page with WPML.




