Version Description
- New filter of rename uploads media, for better plugin support
Download this release
Release Info
Developer | YurchenkoEV |
Plugin | WP Translitera |
Version | 160521 |
Comparing to | |
See all releases |
Code changes from version 160415 to 160521
- readme.txt +4 -1
- wp-translitera.php +13 -3
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://yur4enko.com/
|
|
4 |
Tags: translate, rus-to-lat, Seo, tag, record, page, transliterate, transliteration
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.6
|
7 |
-
Stable tag:
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -24,6 +24,9 @@ Automatical from repository or unzip in plugins and activate in ACP.
|
|
24 |
|
25 |
== Changelog ==
|
26 |
|
|
|
|
|
|
|
27 |
= 160415 =
|
28 |
* Added ukranian language support
|
29 |
* Fix some bug
|
4 |
Tags: translate, rus-to-lat, Seo, tag, record, page, transliterate, transliteration
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.6
|
7 |
+
Stable tag: 160521
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
24 |
|
25 |
== Changelog ==
|
26 |
|
27 |
+
= 160521 =
|
28 |
+
* New filter of rename uploads media, for better plugin support
|
29 |
+
|
30 |
= 160415 =
|
31 |
* Added ukranian language support
|
32 |
* Fix some bug
|
wp-translitera.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Translitera
|
4 |
Plugin URI: http://yur4enko.com/category/moi-proekty/wp-translitera
|
5 |
Description: Plug-in for transliteration permanent permalink records , pages, and tag
|
6 |
-
Version:
|
7 |
Author: Evgen Yurchenko
|
8 |
Text Domain: wp_translitera
|
9 |
Domain Path: /languages/
|
@@ -29,6 +29,7 @@ Author URI: http://yur4enko.com/
|
|
29 |
|
30 |
class wp_translitera {//wp=>3.0 php=>5.2.4
|
31 |
|
|
|
32 |
protected static function createlocale() {//wp=>3.0 php=>5.2.4
|
33 |
$loc = get_locale();
|
34 |
if ($loc == 'ru_RU') {//Русская локализация
|
@@ -44,7 +45,7 @@ class wp_translitera {//wp=>3.0 php=>5.2.4
|
|
44 |
'ъ'=>'','Ы'=>'Y','ы'=>'y','Ь'=>'','ь'=>'','Э'=>'Je','э'=>'je',
|
45 |
'Ю'=>'Ju','ю'=>'ju','Я'=>'Ja','я'=>'ja'
|
46 |
);
|
47 |
-
} elseif ($loc == 'uk') {
|
48 |
$ret = array(
|
49 |
'А'=>'A','а'=>'a','Б'=>'B','б'=>'b','В'=>'V','в'=>'v','Г'=>'H',
|
50 |
'г'=>'h','Ґ'=>'G','ґ'=>'g','Д'=>'D','д'=>'d','Е'=>'E','е'=>'e',
|
@@ -144,6 +145,7 @@ class wp_translitera {//wp=>3.0 php=>5.2.4
|
|
144 |
load_plugin_textdomain('wp_translitera', false, dirname(plugin_basename(__FILE__)).'/languages');
|
145 |
}
|
146 |
|
|
|
147 |
public static function getoptions() {//wp=>3.0 php=>5.2.4
|
148 |
$set = get_option('wp_translitera');
|
149 |
if (gettype($set) != 'array') {
|
@@ -177,6 +179,14 @@ class wp_translitera {//wp=>3.0 php=>5.2.4
|
|
177 |
}
|
178 |
return $value;
|
179 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
}
|
181 |
|
182 |
//wp=>3.0 php=>5.2.4
|
@@ -187,6 +197,6 @@ add_action('admin_menu', array('wp_translitera', 'add_menu'));
|
|
187 |
//Загружка языковой поддержки
|
188 |
add_action('init', array('wp_translitera', 'initlang'));
|
189 |
//Переименовываение загружаемых файлов
|
190 |
-
add_filter('
|
191 |
//Обработка удаления
|
192 |
register_uninstall_hook(__FILE__,array('wp_translitera','tr_delete'));
|
3 |
Plugin Name: WP Translitera
|
4 |
Plugin URI: http://yur4enko.com/category/moi-proekty/wp-translitera
|
5 |
Description: Plug-in for transliteration permanent permalink records , pages, and tag
|
6 |
+
Version: 160521
|
7 |
Author: Evgen Yurchenko
|
8 |
Text Domain: wp_translitera
|
9 |
Domain Path: /languages/
|
29 |
|
30 |
class wp_translitera {//wp=>3.0 php=>5.2.4
|
31 |
|
32 |
+
//Создаем локализации
|
33 |
protected static function createlocale() {//wp=>3.0 php=>5.2.4
|
34 |
$loc = get_locale();
|
35 |
if ($loc == 'ru_RU') {//Русская локализация
|
45 |
'ъ'=>'','Ы'=>'Y','ы'=>'y','Ь'=>'','ь'=>'','Э'=>'Je','э'=>'je',
|
46 |
'Ю'=>'Ju','ю'=>'ju','Я'=>'Ja','я'=>'ja'
|
47 |
);
|
48 |
+
} elseif ($loc == 'uk') {//Украинская локализация
|
49 |
$ret = array(
|
50 |
'А'=>'A','а'=>'a','Б'=>'B','б'=>'b','В'=>'V','в'=>'v','Г'=>'H',
|
51 |
'г'=>'h','Ґ'=>'G','ґ'=>'g','Д'=>'D','д'=>'d','Е'=>'E','е'=>'e',
|
145 |
load_plugin_textdomain('wp_translitera', false, dirname(plugin_basename(__FILE__)).'/languages');
|
146 |
}
|
147 |
|
148 |
+
//Получаем настройки
|
149 |
public static function getoptions() {//wp=>3.0 php=>5.2.4
|
150 |
$set = get_option('wp_translitera');
|
151 |
if (gettype($set) != 'array') {
|
179 |
}
|
180 |
return $value;
|
181 |
}
|
182 |
+
|
183 |
+
//Обработка файлов загружаемых из форм
|
184 |
+
public static function rename_uploads_additional($value, $filename_raw) {//wp=>0.0.0 php=>5.2.4
|
185 |
+
if (wp_translitera::getset('tranliterate_uploads_file')){
|
186 |
+
$value = wp_translitera::transliterate($value);
|
187 |
+
}
|
188 |
+
return $value;
|
189 |
+
}
|
190 |
}
|
191 |
|
192 |
//wp=>3.0 php=>5.2.4
|
197 |
//Загружка языковой поддержки
|
198 |
add_action('init', array('wp_translitera', 'initlang'));
|
199 |
//Переименовываение загружаемых файлов
|
200 |
+
add_filter('sanitize_file_name',array('wp_translitera', 'rename_uploads_additional'),10,2);
|
201 |
//Обработка удаления
|
202 |
register_uninstall_hook(__FILE__,array('wp_translitera','tr_delete'));
|