ACF qTranslate - Version 1.2

Version Description

Monkey patch qTranslate to fix bug with multiple WYSIWYG editors.

Download this release

Release Info

Developer funkjedi
Plugin Icon wp plugin ACF qTranslate
Version 1.2
Comparing to
See all releases

Code changes from version 1.1 to 1.2

Files changed (2) hide show
  1. acf-qtranslate.php +13 -1
  2. readme.txt +6 -2
acf-qtranslate.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Advanced Custom Fields: qTranslate
4
  Plugin URI: http://github.com/funkjedi/acf-qtranslate
5
  Description: Provides multilingual versions of the text, text area, and wysiwyg fields.
6
- Version: 1.1.0
7
  Author: funkjedi
8
  Author URI: http://funkjedi.com
9
  License: GPLv2 or later
@@ -44,3 +44,15 @@ function acf_qtranslate_plugin_format_value_for_api($value) {
44
 
45
  return $value;
46
  }
 
 
 
 
 
 
 
 
 
 
 
 
3
  Plugin Name: Advanced Custom Fields: qTranslate
4
  Plugin URI: http://github.com/funkjedi/acf-qtranslate
5
  Description: Provides multilingual versions of the text, text area, and wysiwyg fields.
6
+ Version: 1.2.0
7
  Author: funkjedi
8
  Author URI: http://funkjedi.com
9
  License: GPLv2 or later
44
 
45
  return $value;
46
  }
47
+
48
+
49
+ add_action('plugins_loaded', 'acf_qtranslate_monkey_patch', 3);
50
+ function acf_qtranslate_monkey_patch() {
51
+ global $q_config;
52
+
53
+ // http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=3497
54
+ if (strpos($q_config['js']['qtrans_switch'], 'originalSwitchEditors') === false) {
55
+ $q_config['js']['qtrans_switch'] = "originalSwitchEditors = jQuery.extend(true, {}, switchEditors);\n" . $q_config['js']['qtrans_switch'];
56
+ $q_config['js']['qtrans_switch'] = preg_replace("/(var vta = document\.getElementById\('qtrans_textarea_' \+ id\);)/", "\$1\nif(!vta)return originalSwitchEditors.go(id, lang);", $q_config['js']['qtrans_switch']);
57
+ }
58
+ }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: funkjedi
3
  Tags: acf, advanced custom fields, qtranslate, add-on, admin
4
  Requires at least: 3.0.0
5
  Tested up to: 3.7.1
6
- Version: 1.1
7
- Stable tag: 1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -13,6 +13,7 @@ Adds qTranslate compatible fields for Text, Text Area, Wysiwyg Editor and Image.
13
  == Description ==
14
 
15
  **Requires the following plugins**
 
16
  * [Advanced Custom Fields](http://wordpress.org/extend/plugins/advanced-custom-fields/)
17
  * [qTranslate](http://wordpress.org/plugins/qtranslate/)
18
 
@@ -47,6 +48,9 @@ The plugin is based on code samples posted to the [ACF support forums](http://ol
47
 
48
  == Changelog ==
49
 
 
 
 
50
  = 1.1 =
51
  Added support for Image Fields. Thanks to bookwyrm for the contribution.
52
 
3
  Tags: acf, advanced custom fields, qtranslate, add-on, admin
4
  Requires at least: 3.0.0
5
  Tested up to: 3.7.1
6
+ Version: 1.2
7
+ Stable tag: 1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
13
  == Description ==
14
 
15
  **Requires the following plugins**
16
+
17
  * [Advanced Custom Fields](http://wordpress.org/extend/plugins/advanced-custom-fields/)
18
  * [qTranslate](http://wordpress.org/plugins/qtranslate/)
19
 
48
 
49
  == Changelog ==
50
 
51
+ = 1.2 =
52
+ Monkey patch qTranslate to fix [bug with multiple WYSIWYG editors](http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=3497).
53
+
54
  = 1.1 =
55
  Added support for Image Fields. Thanks to bookwyrm for the contribution.
56