WP Multibyte Patch - Version 1.6.2

Version Description

Download this release

Release Info

Developer tenpura
Plugin Icon wp plugin WP Multibyte Patch
Version 1.6.2
Comparing to
See all releases

Code changes from version 1.6.1 to 1.6.2

ext/ja/class.php CHANGED
@@ -3,7 +3,7 @@
3
  * WP Multibyte Patch Japanese Locale Extension
4
  *
5
  * @package WP_Multibyte_Patch
6
- * @version 1.6.1
7
  * @author Seisuke Kuraishi <210pura@gmail.com>
8
  * @copyright Copyright (c) 2012 Seisuke Kuraishi, Tinybit Inc.
9
  * @license http://opensource.org/licenses/gpl-2.0.php GPLv2
@@ -146,6 +146,20 @@ class multibyte_patch_ext extends multibyte_patch {
146
  wp_enqueue_style('wpmp-admin-custom');
147
  }
148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  function __construct() {
150
  // mbstring functions are always required for ja.
151
  $this->mbfunctions_required = true;
@@ -156,6 +170,7 @@ class multibyte_patch_ext extends multibyte_patch {
156
  $this->conf['patch_process_search_terms'] = true;
157
  $this->conf['patch_admin_custom_css'] = true;
158
  $this->conf['patch_force_character_count'] = true;
 
159
  // auto, JIS, UTF-8
160
  $this->conf['mail_mode'] = 'JIS';
161
 
3
  * WP Multibyte Patch Japanese Locale Extension
4
  *
5
  * @package WP_Multibyte_Patch
6
+ * @version 1.6.2
7
  * @author Seisuke Kuraishi <210pura@gmail.com>
8
  * @copyright Copyright (c) 2012 Seisuke Kuraishi, Tinybit Inc.
9
  * @license http://opensource.org/licenses/gpl-2.0.php GPLv2
146
  wp_enqueue_style('wpmp-admin-custom');
147
  }
148
 
149
+ function wp_trim_words($text = '', $num_words = 110, $more = '', $original_text = '') {
150
+ if('characters' != _x('words', 'word count: words or characters?'))
151
+ return $text;
152
+
153
+ $text = $original_text;
154
+ $text = wp_strip_all_tags($text);
155
+ $text = trim(preg_replace("/[\n\r\t ]+/", ' ', $text), ' ');
156
+
157
+ if(mb_strlen($text, $this->blog_encoding) > $num_words)
158
+ $text = mb_substr($text, 0, $num_words, $this->blog_encoding) . $more;
159
+
160
+ return $text;
161
+ }
162
+
163
  function __construct() {
164
  // mbstring functions are always required for ja.
165
  $this->mbfunctions_required = true;
170
  $this->conf['patch_process_search_terms'] = true;
171
  $this->conf['patch_admin_custom_css'] = true;
172
  $this->conf['patch_force_character_count'] = true;
173
+ $this->conf['patch_wp_trim_words'] = true;
174
  // auto, JIS, UTF-8
175
  $this->conf['mail_mode'] = 'JIS';
176
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: tenpura
3
  Tags: multibyte,i18n,wp-multibyte-patch,Japanese
4
  Requires at least: 3.4-RC2
5
  Tested up to: 3.4
6
- Stable tag: 1.6.1
7
 
8
  Multibyte functionality enhancement for the WordPress Japanese package.
9
 
3
  Tags: multibyte,i18n,wp-multibyte-patch,Japanese
4
  Requires at least: 3.4-RC2
5
  Tested up to: 3.4
6
+ Stable tag: 1.6.2
7
 
8
  Multibyte functionality enhancement for the WordPress Japanese package.
9
 
wp-multibyte-patch.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: WP Multibyte Patch
4
  Description: Multibyte functionality enhancement for the WordPress Japanese package.
5
- Version: 1.6.1
6
  Plugin URI: http://eastcoder.com/code/wp-multibyte-patch/
7
  Author: Seisuke Kuraishi
8
  Author URI: http://tinybit.co.jp/
@@ -15,7 +15,7 @@ Domain Path: /languages
15
  * Multibyte functionality enhancement for the WordPress Japanese package.
16
  *
17
  * @package WP_Multibyte_Patch
18
- * @version 1.6.1
19
  * @author Seisuke Kuraishi <210pura@gmail.com>
20
  * @copyright Copyright (c) 2012 Seisuke Kuraishi, Tinybit Inc.
21
  * @license http://opensource.org/licenses/gpl-2.0.php GPLv2
@@ -37,6 +37,7 @@ class multibyte_patch {
37
  'patch_incoming_trackback' => false,
38
  'patch_incoming_pingback' => false,
39
  'patch_wp_trim_excerpt' => true,
 
40
  'patch_get_comment_excerpt' => true,
41
  'patch_dashboard_recent_drafts' => true,
42
  'patch_process_search_terms' => false,
@@ -367,6 +368,9 @@ class multibyte_patch {
367
  add_filter('bp_get_activity_content_body', array(&$this, 'bp_get_activity_content_body'), 99);
368
  }
369
 
 
 
 
370
  // add action
371
  add_action('wp', array(&$this, 'query_based_settings'));
372
 
2
  /*
3
  Plugin Name: WP Multibyte Patch
4
  Description: Multibyte functionality enhancement for the WordPress Japanese package.
5
+ Version: 1.6.2
6
  Plugin URI: http://eastcoder.com/code/wp-multibyte-patch/
7
  Author: Seisuke Kuraishi
8
  Author URI: http://tinybit.co.jp/
15
  * Multibyte functionality enhancement for the WordPress Japanese package.
16
  *
17
  * @package WP_Multibyte_Patch
18
+ * @version 1.6.2
19
  * @author Seisuke Kuraishi <210pura@gmail.com>
20
  * @copyright Copyright (c) 2012 Seisuke Kuraishi, Tinybit Inc.
21
  * @license http://opensource.org/licenses/gpl-2.0.php GPLv2
37
  'patch_incoming_trackback' => false,
38
  'patch_incoming_pingback' => false,
39
  'patch_wp_trim_excerpt' => true,
40
+ 'patch_wp_trim_words' => false,
41
  'patch_get_comment_excerpt' => true,
42
  'patch_dashboard_recent_drafts' => true,
43
  'patch_process_search_terms' => false,
368
  add_filter('bp_get_activity_content_body', array(&$this, 'bp_get_activity_content_body'), 99);
369
  }
370
 
371
+ if(method_exists($this, 'wp_trim_words') && false !== $this->conf['patch_wp_trim_words'])
372
+ add_filter('wp_trim_words', array(&$this, 'wp_trim_words'), 99, 4);
373
+
374
  // add action
375
  add_action('wp', array(&$this, 'query_based_settings'));
376
 
wpmp-config-sample-ja.php CHANGED
@@ -79,6 +79,7 @@ $wpmp_conf['patch_wp_mail'] = true;
79
  $wpmp_conf['patch_incoming_trackback'] = true;
80
  $wpmp_conf['patch_incoming_pingback'] = true;
81
  $wpmp_conf['patch_wp_trim_excerpt'] = true;
 
82
  $wpmp_conf['patch_get_comment_excerpt'] = true;
83
  $wpmp_conf['patch_dashboard_recent_drafts'] = true;
84
  $wpmp_conf['patch_process_search_terms'] = true;
79
  $wpmp_conf['patch_incoming_trackback'] = true;
80
  $wpmp_conf['patch_incoming_pingback'] = true;
81
  $wpmp_conf['patch_wp_trim_excerpt'] = true;
82
+ $wpmp_conf['patch_wp_trim_words'] = true;
83
  $wpmp_conf['patch_get_comment_excerpt'] = true;
84
  $wpmp_conf['patch_dashboard_recent_drafts'] = true;
85
  $wpmp_conf['patch_process_search_terms'] = true;