Cyr-To-Lat - Version 3.2

Version Description

  • Added transliteration when publishing via XML-RPC
  • Fixed Invalid Taxonomy error when viewing the most used tags
Download this release

Release Info

Developer SergeyBiryukov
Plugin Icon 128x128 Cyr-To-Lat
Version 3.2
Comparing to
See all releases

Code changes from version 3.0 to 3.2

Files changed (2) hide show
  1. cyr-to-lat.php +3 -3
  2. readme.txt +33 -5
cyr-to-lat.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://wordpress.org/extend/plugins/cyr2lat/
5
  Description: Converts Cyrillic characters in post and term slugs to Latin characters. Useful for creating human-readable URLs. Based on the original plugin by Anton Skorobogatov.
6
  Author: Sol, Sergey Biryukov
7
  Author URI: http://ru.wordpress.org/
8
- Version: 3.0
9
  */
10
 
11
  function ctl_sanitize_title($title) {
@@ -35,14 +35,14 @@ function ctl_sanitize_title($title) {
35
  $term = $wpdb->get_var("SELECT slug FROM {$wpdb->terms} WHERE name = '$title'");
36
  if ( empty($term) ) {
37
  $title = strtr($title, apply_filters('ctl_table', $iso9_table));
38
- $title = preg_replace("/[^A-Za-z0-9`'\-\.]/", '-', $title);
39
  } else {
40
  $title = $term;
41
  }
42
 
43
  return $title;
44
  }
45
- if ( !empty($_POST) ) {
46
  add_filter('sanitize_title', 'ctl_sanitize_title', 9);
47
  add_filter('sanitize_file_name', 'ctl_sanitize_title');
48
  }
5
  Description: Converts Cyrillic characters in post and term slugs to Latin characters. Useful for creating human-readable URLs. Based on the original plugin by Anton Skorobogatov.
6
  Author: Sol, Sergey Biryukov
7
  Author URI: http://ru.wordpress.org/
8
+ Version: 3.2
9
  */
10
 
11
  function ctl_sanitize_title($title) {
35
  $term = $wpdb->get_var("SELECT slug FROM {$wpdb->terms} WHERE name = '$title'");
36
  if ( empty($term) ) {
37
  $title = strtr($title, apply_filters('ctl_table', $iso9_table));
38
+ $title = preg_replace("/[^A-Za-z0-9`'_\-\.]/", '-', $title);
39
  } else {
40
  $title = $term;
41
  }
42
 
43
  return $title;
44
  }
45
+ if ( !empty($_POST) || !empty($_GET['action']) && $_GET['action'] == 'edit' || defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) {
46
  add_filter('sanitize_title', 'ctl_sanitize_title', 9);
47
  add_filter('sanitize_file_name', 'ctl_sanitize_title');
48
  }
readme.txt CHANGED
@@ -1,15 +1,22 @@
1
  === Cyr-To-Lat ===
2
  Contributors: Atrax, SergeyBiryukov
3
- Tags: l10n, translations, transliteration, slugs, russian, rustolat
4
  Requires at least: 2.3
5
- Tested up to: 3.0
6
- Stable tag: 3.0
7
 
8
- Converts Cyrillic characters in post and term slugs to Latin characters.
9
 
10
  == Description ==
11
 
12
- Converts Cyrillic characters in post and term slugs to Latin characters. Useful for creating human-readable URLs.
 
 
 
 
 
 
 
13
 
14
  Based on the original Rus-To-Lat plugin by Anton Skorobogatov.
15
 
@@ -18,8 +25,29 @@ Based on the original Rus-To-Lat plugin by Anton Skorobogatov.
18
  1. Upload `cyr2lat` folder to the `/wp-content/plugins/` directory.
19
  2. Activate the plugin through the 'Plugins' menu in WordPress.
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  == Changelog ==
22
 
 
 
 
 
 
 
 
23
  = 3.0 =
24
  * Added automatic conversion of existing post, page and term slugs
25
  * Added saving of existing post and page permalinks integrity
1
  === Cyr-To-Lat ===
2
  Contributors: Atrax, SergeyBiryukov
3
+ Tags: cyrillic, latin, l10n, russian, rustolat, slugs, translations, transliteration
4
  Requires at least: 2.3
5
+ Tested up to: 3.1
6
+ Stable tag: 3.2
7
 
8
+ Converts Cyrillic characters in post, page and term slugs to Latin characters.
9
 
10
  == Description ==
11
 
12
+ Converts Cyrillic characters in post, page and term slugs to Latin characters. Useful for creating human-readable URLs.
13
+
14
+ = Features =
15
+ * Automatically converts existing post, page and term slugs on activation
16
+ * Saves existing post and page permalinks integrity
17
+ * Performs transliteration of attachment file names
18
+ * Includes Russian, Belarusian, Ukrainian, Bulgarian and Macedonian characters
19
+ * Transliteration table can be customized without editing the plugin itself
20
 
21
  Based on the original Rus-To-Lat plugin by Anton Skorobogatov.
22
 
25
  1. Upload `cyr2lat` folder to the `/wp-content/plugins/` directory.
26
  2. Activate the plugin through the 'Plugins' menu in WordPress.
27
 
28
+ == Frequently Asked Questions ==
29
+
30
+ = How can I define my own substitutions? =
31
+
32
+ Add this code to your theme's `functions.php` file:
33
+ `
34
+ function my_cyr_to_lat_table($ctl_table) {
35
+ $ctl_table['Ъ'] = 'U';
36
+ $ctl_table['ъ'] = 'u';
37
+ return $ctl_table;
38
+ }
39
+ add_filter('ctl_table', 'my_cyr_to_lat_table');
40
+ `
41
+
42
  == Changelog ==
43
 
44
+ = 3.2 =
45
+ * Added transliteration when publishing via XML-RPC
46
+ * Fixed Invalid Taxonomy error when viewing the most used tags
47
+
48
+ = 3.1 =
49
+ * Fixed transliteration when saving a draft
50
+
51
  = 3.0 =
52
  * Added automatic conversion of existing post, page and term slugs
53
  * Added saving of existing post and page permalinks integrity