diff --git a/README.md b/README.md index 2ddf057..a9555b1 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ [![plugin version](https://img.shields.io/wordpress/plugin/v/so-pinyin-slugs.svg)](https://wordpress.org/plugins/so-pinyin-slugs) -###### Last updated on 2015.08.12 +###### Last updated on 2016.03.10 ###### requires at least WordPress 4.0 -###### tested up to WP 4.4 +###### tested up to WP 4.4.2 ###### Authors: [Piet Bos](https://github.com/senlin), [Denis Cao](https://github.com/caoyongsheng) ###### [Stable Version](http://wordpress.org/plugins/so-pinyin-slugs) (via WordPress Plugins Repository) ###### [Plugin homepage](http://so-wp.com/?p=17) @@ -36,7 +36,6 @@ The SO Pinyin Slugs plugin has received the [WPML Certification of Compatibility ### Known Issues: * SO Pinyin Slugs will not transform existing slugs -* If the title contains both Chinese characters and alphanumeric characters (abc, 123, etc.) SO Pinyin Slugs will ignore the latter. So if these alphanumeric characters are important, you will need to add them manually to your slug. ### Can I use this plugin also for Traditional Chinese? @@ -69,6 +68,10 @@ This repo is open to _any_ kind of contributions. ## Changelog +### 2.1.0 (2016.03.10) + +* fix to not ignore alphanumerical characters by [vanabel](https://github.com/vanabel), closes [issue #4](https://github.com/senlin/so-pinyin-slugs/issues/4) + ### 2.0.4 (2015.08.07) * TWEAK: header settings page; only showed half logo after 2.0.3 update diff --git a/inc/functions.php b/inc/functions.php index 2f618ae..d12013c 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -47,8 +47,13 @@ function getPinyinSlug( $strTitle ) { } } } else { - //non chinese characters will be ignored - $strRet .= preg_replace( "/[^A-Za-z0-9\-]/", '', chr( $byte1st ) ); + /** + * fix to not ignore alphanumerical characters + * by [vanabel](https://github.com/vanabel) + * + * @source: //github.com/senlin/so-pinyin-slugs/issues/4 + */ + $strRet .= preg_replace( '/[^A-Za-z0-9\-]/', '$0', chr( $byte1st ) ); } } diff --git a/readme.txt b/readme.txt index 836e036..00ba0f7 100644 --- a/readme.txt +++ b/readme.txt @@ -2,8 +2,8 @@ Contributors: senlin Tags: pinyin, permalinks, slugs, Mandarin, Chinese Requires at least: 4.0 -Tested up to: WP 4.4 -Stable tag: 2.0.4 +Tested up to: WP 4.4.2 +Stable tag: 2.1.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -32,7 +32,7 @@ Thanks for your understanding and cooperation. == Installation == -= Wordpress = += WordPress = Search for "SO Pinyin Slugs" and install with the **Plugins > Add New** back-end page. @@ -52,7 +52,6 @@ Done! = Known Issues: = * SO Pinyin Slugs will not transform existing slugs -* If the title contains both Chinese characters and alphanumeric characters (abc, 123, etc.) SO Pinyin Slugs will ignore the latter. So if these alphanumeric characters are important, you will need to add them manually to your slug. = Can I use this plugin also for Traditional Chinese? = @@ -76,6 +75,10 @@ The SO Pinyin Slugs plugin has received the [WPML Certification of Compatibility == Changelog == += 2.1.0 (2016.03.10) = + +* fix to not ignore alphanumerical characters by [vanabel](https://github.com/vanabel), closes [issue #4](https://github.com/senlin/so-pinyin-slugs/issues/4) + = 2.0.4 (2015.08.07) = * TWEAK: header settings page; only showed half logo after 2.0.3 update diff --git a/so-pinyin-slugs.php b/so-pinyin-slugs.php index b53943d..bca6818 100644 --- a/so-pinyin-slugs.php +++ b/so-pinyin-slugs.php @@ -4,14 +4,14 @@ Plugin URI: http://so-wp.com/?p=17 Description: Transforms Chinese character titles (of Posts, Pages and all other content types that use slugs) into a permalink friendly slug, showing pinyin that can be read by humans and (Chinese) search engines alike. Author: SO WP -Version: 2.0.4 +Version: 2.1.0 Author URI: http://so-wp.com/plugins/ Text Domain: so-pinyin-slugs Domain Path: /languages */ /** - * Copyright 2014-2015 Piet Bos (email : piet@so-wp.com) + * Copyright 2014-2016 Piet Bos (email : piet@so-wp.com) * * The SO Pinyin Slugs plugin is a fork of the original [Pinyin Permalinks](http://wordpress.org/plugins/pinyin-permalink/) plugin * by user [xiaole_tao](http://profiles.wordpress.org/xiaole_tao/) who has seemingly abandoned his plugin as he never responded to emails.