Linux 软件免费装
Banner图

Cyr-To-Lat

开发者 SergeyBiryukov
mihdan
karevn
webvitaly
kaggdesign
更新时间 2021年7月28日 00:02
PHP版本: 5.6.20 及以上
WordPress版本: 5.8

标签

russian l10n translations slugs cyrillic transliteration latin rustolat bulgarian belorussian ukrainian macedonian georgian cyr-to-lat kazakh cyr2lat

下载

2.1 3.0 3.1 3.2 3.3 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.7 4.0 4.1 4.1.1 4.1.2 4.2.1 4.2.2 4.2.3 4.3 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.4.0 4.5.1 4.5.2 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 5.0.0 5.0.1 2.0 5.1.0 1.0 3.4 4.2 4.5.0 5.0.2 5.0.4 1.0.1 5.0.3 5.2.0

详情介绍:

Converts Cyrillic characters in post, page and term slugs to Latin characters. Useful for creating human-readable URLs. Features Based on the original Rus-To-Lat plugin by Anton Skorobogatov.

安装:

  1. Upload cyr2lat folder to the /wp-content/plugins/ directory.
  2. 通过WordPress的“插件”菜单激活插件。

屏幕截图:

  • Tables settings page
  • Converter settings page
  • Block editor with transliterated slug
  • WPML Certificate

常见问题:

How can I define my own substitutions?

Add this code to your theme's functions.php file: ` /**

  • 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' ); `

How can I redefine non-standard locale?

For instance, if your non-standard locale is uk_UA, you can redefine it to uk by adding the following code to your theme's function.php file: ` /**

  • 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' ); `

How can I define own transliteration of titles?

Add similar code to your theme's functions.php file: ` /**

  • 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 ); `

How can I define own transliteration of filenames?

Add similar code to your theme's functions.php file: ` /**

  • 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 ); `

How can I limit post types for background conversion?

Add similar code to your theme's functions.php file: ` /**

  • 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' ); `

How can I convert many posts/terms using wp-cli?

Use the following command in the console: wp cyr2lat regenerate [--post_type=<post_type>] [--post_status=<post_status>] Where -post_type is list of post types, -post_status is list of post statuses.

How can I regenerate thumbnails safely?

Regeneration of thumbnails with the command wp media regenerate can break links in old posts as file names become transliterated. To avoid it, deactivate cyr2lat plugin during regeneration: wp media regenerate --skip-plugins=cyr2lat

Can I contribute?

Yes you can!

更新日志:

5.2.0 (27.07.2021) 5.1.0 (19.07.2021) 5.0.4 (17.04.2021) 5.0.3 (03.04.2021) 5.0.2 (27.03.2021) 5.0.1 (22.03.2021) 5.0.0 (18.03.2021) 4.6.4 (03.03.2021) 4.6.3 (21.02.2021) 4.6.2 (11.02.2021) 4.6.1 (10.02.2021) 4.6.0 (10.02.2021) 4.5.2 (08.12.2020) 4.5.1 (07.12.2020) 4.5.0 (18.05.2020) 4.4.0 (18.04.2020) 4.3.5 (28.03.2020) 4.3.4 (22.02.2020) 4.3.3 (20.02.2020) 4.3.2 (29.12.2019) 4.3.1 (27.12.2019) 4.3 (14.12.2019) 4.2.3 (29.08.2019) 4.2.2 (28.08.2019) 4.2.1 (23.06.2019) 4.2 (28.05.2019) 4.1.2 (22.05.2019) 4.1.1 (22.05.2019) 4.1 (21.05.2019) 4.0 (24.04.2019) 3.7 (12.04.2019) 3.6.5 (11.02.2019) 3.6.4 (06.02.2019) 3.6.3 (04.02.2019) 3.6.2 (01.02.2019) 3.6.1 (31.01.2019) 3.6 (31.01.2019) 3.4 (21.01.2019) 3.3 (18.01.2019) 3.2 3.1 3.0 2.1 2.0 1.0.1 1.0