WP Multibyte Patch - Version 1.6.3

Version Description

Download this release

Release Info

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

Code changes from version 1.6.2 to 1.6.3

ext/ja/admin.css CHANGED
@@ -2,5 +2,5 @@
2
 
3
  body *:not(textarea) {
4
  font-style: normal !important;
5
- font-family: "Helvetica Neue", Helvetica, "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", "メイリオ", Meiryo, "MS Pゴシック", Arial, Verdana, sans-serif !important;
6
  }
2
 
3
  body *:not(textarea) {
4
  font-style: normal !important;
5
+ font-family: sans-serif !important;
6
  }
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.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
@@ -142,7 +142,12 @@ class multibyte_patch_ext extends multibyte_patch {
142
  }
143
 
144
  function admin_custom_css() {
145
- wp_register_style('wpmp-admin-custom', plugin_dir_url(__FILE__) . 'admin.css', array(), false);
 
 
 
 
 
146
  wp_enqueue_style('wpmp-admin-custom');
147
  }
148
 
@@ -170,9 +175,11 @@ class multibyte_patch_ext extends multibyte_patch {
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
 
177
  parent::__construct();
178
  }
3
  * WP Multibyte Patch Japanese Locale Extension
4
  *
5
  * @package WP_Multibyte_Patch
6
+ * @version 1.6.3
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
142
  }
143
 
144
  function admin_custom_css() {
145
+ if(empty($this->conf['admin_custom_css_url']))
146
+ $url = plugin_dir_url(__FILE__) . 'admin.css';
147
+ else
148
+ $url = $this->conf['admin_custom_css_url'];
149
+
150
+ wp_register_style('wpmp-admin-custom', $url, array(), false);
151
  wp_enqueue_style('wpmp-admin-custom');
152
  }
153
 
175
  $this->conf['patch_process_search_terms'] = true;
176
  $this->conf['patch_admin_custom_css'] = true;
177
  $this->conf['patch_force_character_count'] = true;
178
+ $this->conf['patch_force_twentytwelve_open_sans_off'] = true;
179
  $this->conf['patch_wp_trim_words'] = true;
180
  // auto, JIS, UTF-8
181
  $this->conf['mail_mode'] = 'JIS';
182
+ $this->conf['admin_custom_css_url'] = '';
183
 
184
  parent::__construct();
185
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  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.2
7
 
8
  Multibyte functionality enhancement for the WordPress Japanese package.
9
 
2
  Contributors: tenpura
3
  Tags: multibyte,i18n,wp-multibyte-patch,Japanese
4
  Requires at least: 3.4-RC2
5
+ Tested up to: 3.4.2
6
+ Stable tag: 1.6.3
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.2
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.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
@@ -45,6 +45,7 @@ class multibyte_patch {
45
  'patch_wplink_js' => true,
46
  'patch_word_count_js' => true,
47
  'patch_force_character_count' => false,
 
48
  'patch_sanitize_file_name' => true,
49
  'patch_bp_create_excerpt' => false,
50
  'bp_excerpt_mblength' => 110,
@@ -280,6 +281,10 @@ class multibyte_patch {
280
  return $translations;
281
  }
282
 
 
 
 
 
283
  function wp_dashboard_recent_drafts( $drafts = false ) {
284
  if ( !$drafts ) {
285
  $drafts_query = new WP_Query( array(
@@ -316,7 +321,7 @@ class multibyte_patch {
316
  function dashboard_recent_drafts() {
317
  global $wp_meta_boxes;
318
  if(!empty($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']['callback']))
319
- $wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']['callback'] = array(&$this, 'wp_dashboard_recent_drafts');
320
  }
321
 
322
  function query_based_settings() {
@@ -342,59 +347,62 @@ class multibyte_patch {
342
  function filters_after_setup_theme() {
343
  // add filter
344
  if(false !== $this->conf['patch_force_character_count'] && 'characters' != _x('words', 'word count: words or characters?'))
345
- add_filter('gettext_with_context', array(&$this, 'force_character_count'), 10, 3);
346
  }
347
 
348
  function filters() {
349
  // add filter
350
- add_filter('preprocess_comment', array(&$this, 'preprocess_comment'), 99);
351
 
352
  if(false !== $this->conf['patch_incoming_pingback'])
353
- add_filter('pre_remote_source', array(&$this, 'pre_remote_source'), 10, 2);
354
 
355
  if(false !== $this->conf['patch_wp_trim_excerpt']) {
356
- add_filter('excerpt_length', array(&$this, 'excerpt_mblength'), 99);
357
- add_filter('excerpt_more', array(&$this, 'excerpt_more'), 9);
358
  }
359
 
360
  if(false !== $this->conf['patch_get_comment_excerpt'])
361
- add_filter('get_comment_excerpt', array(&$this, 'get_comment_excerpt'));
362
 
363
  if(false !== $this->conf['patch_sanitize_file_name'])
364
- add_filter('sanitize_file_name', array(&$this, 'sanitize_file_name'));
365
 
366
  if(false !== $this->conf['patch_bp_create_excerpt']) {
367
- add_filter('bp_create_excerpt', array(&$this, 'bp_create_excerpt'), 99);
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
 
377
  if(method_exists($this, 'process_search_terms') && false !== $this->conf['patch_process_search_terms'])
378
- add_action('sanitize_comment_cookies', array(&$this, 'process_search_terms'));
379
 
380
  if(method_exists($this, 'wp_mail') && false !== $this->conf['patch_wp_mail'])
381
- add_action('phpmailer_init', array(&$this, 'wp_mail'));
382
 
383
  if(method_exists($this, 'admin_custom_css') && false !== $this->conf['patch_admin_custom_css']) {
384
- add_action('admin_enqueue_scripts', array(&$this, 'admin_custom_css'), 99);
385
- add_action('customize_controls_enqueue_scripts', array(&$this, 'admin_custom_css'), 99);
386
  }
387
 
388
  if(false !== $this->conf['patch_wplink_js'])
389
- add_action('wp_default_scripts', array(&$this, 'wplink_js'), 9);
390
 
391
  if(false !== $this->conf['patch_word_count_js'])
392
- add_action('wp_default_scripts', array(&$this, 'word_count_js'), 9);
393
 
394
  if(false !== $this->conf['patch_dashboard_recent_drafts'])
395
- add_action('wp_dashboard_setup', array(&$this, 'dashboard_recent_drafts'));
 
 
 
396
 
397
- add_action('after_setup_theme', array(&$this, 'filters_after_setup_theme'));
398
  }
399
 
400
  function mbfunctions_exist() {
@@ -449,7 +457,7 @@ class multibyte_patch {
449
  $this->debug_suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
450
 
451
  load_textdomain($this->textdomain, plugin_dir_path(__FILE__) . $this->lang_dir . '/' . $this->textdomain . '-' . get_locale() . '.mo');
452
- register_activation_hook(__FILE__, array(&$this, 'activation_check'));
453
  $this->filters();
454
  }
455
  }
2
  /*
3
  Plugin Name: WP Multibyte Patch
4
  Description: Multibyte functionality enhancement for the WordPress Japanese package.
5
+ Version: 1.6.3
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.3
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
45
  'patch_wplink_js' => true,
46
  'patch_word_count_js' => true,
47
  'patch_force_character_count' => false,
48
+ 'patch_force_twentytwelve_open_sans_off' => false,
49
  'patch_sanitize_file_name' => true,
50
  'patch_bp_create_excerpt' => false,
51
  'bp_excerpt_mblength' => 110,
281
  return $translations;
282
  }
283
 
284
+ function force_twentytwelve_open_sans_off() {
285
+ wp_dequeue_style('twentytwelve-fonts');
286
+ }
287
+
288
  function wp_dashboard_recent_drafts( $drafts = false ) {
289
  if ( !$drafts ) {
290
  $drafts_query = new WP_Query( array(
321
  function dashboard_recent_drafts() {
322
  global $wp_meta_boxes;
323
  if(!empty($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']['callback']))
324
+ $wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']['callback'] = array($this, 'wp_dashboard_recent_drafts');
325
  }
326
 
327
  function query_based_settings() {
347
  function filters_after_setup_theme() {
348
  // add filter
349
  if(false !== $this->conf['patch_force_character_count'] && 'characters' != _x('words', 'word count: words or characters?'))
350
+ add_filter('gettext_with_context', array($this, 'force_character_count'), 10, 3);
351
  }
352
 
353
  function filters() {
354
  // add filter
355
+ add_filter('preprocess_comment', array($this, 'preprocess_comment'), 99);
356
 
357
  if(false !== $this->conf['patch_incoming_pingback'])
358
+ add_filter('pre_remote_source', array($this, 'pre_remote_source'), 10, 2);
359
 
360
  if(false !== $this->conf['patch_wp_trim_excerpt']) {
361
+ add_filter('excerpt_length', array($this, 'excerpt_mblength'), 99);
362
+ add_filter('excerpt_more', array($this, 'excerpt_more'), 9);
363
  }
364
 
365
  if(false !== $this->conf['patch_get_comment_excerpt'])
366
+ add_filter('get_comment_excerpt', array($this, 'get_comment_excerpt'));
367
 
368
  if(false !== $this->conf['patch_sanitize_file_name'])
369
+ add_filter('sanitize_file_name', array($this, 'sanitize_file_name'));
370
 
371
  if(false !== $this->conf['patch_bp_create_excerpt']) {
372
+ add_filter('bp_create_excerpt', array($this, 'bp_create_excerpt'), 99);
373
+ add_filter('bp_get_activity_content_body', array($this, 'bp_get_activity_content_body'), 99);
374
  }
375
 
376
  if(method_exists($this, 'wp_trim_words') && false !== $this->conf['patch_wp_trim_words'])
377
+ add_filter('wp_trim_words', array($this, 'wp_trim_words'), 99, 4);
378
 
379
  // add action
380
+ add_action('wp', array($this, 'query_based_settings'));
381
 
382
  if(method_exists($this, 'process_search_terms') && false !== $this->conf['patch_process_search_terms'])
383
+ add_action('sanitize_comment_cookies', array($this, 'process_search_terms'));
384
 
385
  if(method_exists($this, 'wp_mail') && false !== $this->conf['patch_wp_mail'])
386
+ add_action('phpmailer_init', array($this, 'wp_mail'));
387
 
388
  if(method_exists($this, 'admin_custom_css') && false !== $this->conf['patch_admin_custom_css']) {
389
+ add_action('admin_enqueue_scripts', array($this, 'admin_custom_css'), 99);
390
+ add_action('customize_controls_enqueue_scripts', array($this, 'admin_custom_css'), 99);
391
  }
392
 
393
  if(false !== $this->conf['patch_wplink_js'])
394
+ add_action('wp_default_scripts', array($this, 'wplink_js'), 9);
395
 
396
  if(false !== $this->conf['patch_word_count_js'])
397
+ add_action('wp_default_scripts', array($this, 'word_count_js'), 9);
398
 
399
  if(false !== $this->conf['patch_dashboard_recent_drafts'])
400
+ add_action('wp_dashboard_setup', array($this, 'dashboard_recent_drafts'));
401
+
402
+ if(false !== $this->conf['patch_force_twentytwelve_open_sans_off'] && 'twentytwelve' == get_template())
403
+ add_action('wp_enqueue_scripts', array($this, 'force_twentytwelve_open_sans_off'), 99);
404
 
405
+ add_action('after_setup_theme', array($this, 'filters_after_setup_theme'), 99);
406
  }
407
 
408
  function mbfunctions_exist() {
457
  $this->debug_suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
458
 
459
  load_textdomain($this->textdomain, plugin_dir_path(__FILE__) . $this->lang_dir . '/' . $this->textdomain . '-' . get_locale() . '.mo');
460
+ register_activation_hook(__FILE__, array($this, 'activation_check'));
461
  $this->filters();
462
  }
463
  }
wpmp-config-sample-ja.php CHANGED
@@ -57,6 +57,15 @@ $wpmp_conf['dashboard_recent_drafts_mblength'] = 40;
57
  */
58
  $wpmp_conf['mail_mode'] = 'JIS';
59
 
 
 
 
 
 
 
 
 
 
60
  /**
61
  * BuddyPress bp_create_excerpt() 抜粋の最大文字数
62
  *
@@ -87,6 +96,7 @@ $wpmp_conf['patch_admin_custom_css'] = true;
87
  $wpmp_conf['patch_wplink_js'] = true;
88
  $wpmp_conf['patch_word_count_js'] = true;
89
  $wpmp_conf['patch_force_character_count'] = true;
 
90
  $wpmp_conf['patch_sanitize_file_name'] = true;
91
  $wpmp_conf['patch_bp_create_excerpt'] = false;
92
 
57
  */
58
  $wpmp_conf['mail_mode'] = 'JIS';
59
 
60
+ /**
61
+ * 管理パネルカスタム CSS の URL
62
+ *
63
+ * 管理パネルで読み込まれる CSS の URL を任意で指定することができます。
64
+ * 未指定の場合は、デフォルトの CSS が読み込まれます。
65
+ * この設定は $wpmp_conf['patch_admin_custom_css'] が false の場合は無効となります。
66
+ */
67
+ $wpmp_conf['admin_custom_css_url'] = '';
68
+
69
  /**
70
  * BuddyPress bp_create_excerpt() 抜粋の最大文字数
71
  *
96
  $wpmp_conf['patch_wplink_js'] = true;
97
  $wpmp_conf['patch_word_count_js'] = true;
98
  $wpmp_conf['patch_force_character_count'] = true;
99
+ $wpmp_conf['patch_force_twentytwelve_open_sans_off'] = true;
100
  $wpmp_conf['patch_sanitize_file_name'] = true;
101
  $wpmp_conf['patch_bp_create_excerpt'] = false;
102