Skip to content

Commit

Permalink
commit v2.1.0
Browse files Browse the repository at this point in the history
* fix to not ignore alphanumerical characters by
[vanabel](https://github.com/vanabel), closes [issue
#4](#4)
  • Loading branch information
Piet Bos committed Mar 10, 2016
1 parent 0ad55cd commit cd3c48b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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?

Expand Down Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
}
}

Expand Down
11 changes: 7 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand All @@ -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? =

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions so-pinyin-slugs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 : [email protected])
* Copyright 2014-2016 Piet Bos (email : [email protected])
*
* 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.
Expand Down

0 comments on commit cd3c48b

Please sign in to comment.