ACF qTranslate - Version 1.7.19

Version Description

  • Bug Fix: Fixed issue with saving File and Image fields after ACF 5.5.5 upgrade
Download this release

Release Info

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

Code changes from version 1.7.18 to 1.7.19

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.7.18
7
Author: funkjedi
8
Author URI: http://funkjedi.com
9
License: GPLv2 or later
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.7.19
7
Author: funkjedi
8
Author URI: http://funkjedi.com
9
License: GPLv2 or later
assets/common.js CHANGED
@@ -21,6 +21,7 @@ jQuery(function($) {
21
parent.find('.current-language').removeClass('current-language');
22
parent.find('[data-language="' + language + '"]').addClass('current-language');
23
parent.find('input[data-language="' + language + '"], textarea[data-language="' + language + '"]').focus();
24
});
25
26
/**
21
parent.find('.current-language').removeClass('current-language');
22
parent.find('[data-language="' + language + '"]').addClass('current-language');
23
parent.find('input[data-language="' + language + '"], textarea[data-language="' + language + '"]').focus();
24
+ $('.qtranxs-lang-switch[lang="' + language + '"]:first').trigger('click');
25
});
26
27
/**
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
Contributors: funkjedi
3
Tags: acf, advanced custom fields, qtranslate, add-on, admin
4
Requires at least: 3.5.0
5
- Tested up to: 4.6.1
6
- Version: 1.7.18
7
- Stable tag: 1.7.18
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -54,6 +54,9 @@ The plugin is based on code samples posted to the ACF support forums by taeo bac
54
55
== Changelog ==
56
57
= 1.7.18 =
58
* Core: Prevent error on older versions of ACF5
59
* Bug Fix: Updated ACF5 qTranslate File field to match recent ACF update
@@ -167,8 +170,4 @@ The plugin is based on code samples posted to the ACF support forums by taeo bac
167
168
== Upgrade Notice ==
169
170
- = 1.7.7 =
171
- If using qTranslate-X translation of the standard Text, Text Area and WYSIWYG field types is now disabled by default.
172
-
173
- = 1.7.3 =
174
- Removed namespaces to make code compatible with PHP 5.2
2
Contributors: funkjedi
3
Tags: acf, advanced custom fields, qtranslate, add-on, admin
4
Requires at least: 3.5.0
5
+ Tested up to: 4.7.2
6
+ Version: 1.7.19
7
+ Stable tag: 1.7.19
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
54
55
== Changelog ==
56
57
+ = 1.7.19 =
58
+ * Bug Fix: Fixed issue with saving File and Image fields after ACF 5.5.5 upgrade
59
+
60
= 1.7.18 =
61
* Core: Prevent error on older versions of ACF5
62
* Bug Fix: Updated ACF5 qTranslate File field to match recent ACF update
170
171
== Upgrade Notice ==
172
173
+ Bug Fix: Fixed issue with saving File and Image fields after ACF 5.5.5 upgrade
src/acf_5/acf.php CHANGED
@@ -33,11 +33,11 @@ class acf_qtranslate_acf_5 implements acf_qtranslate_acf_interface {
33
require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_5/fields/textarea.php';
34
require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_5/fields/wysiwyg.php';
35
36
- new acf_qtranslate_acf_5_text($this->plugin);
37
- new acf_qtranslate_acf_5_textarea($this->plugin);
38
- new acf_qtranslate_acf_5_wysiwyg($this->plugin);
39
- new acf_qtranslate_acf_5_image($this->plugin);
40
- new acf_qtranslate_acf_5_file($this->plugin);
41
}
42
43
/**
33
require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_5/fields/textarea.php';
34
require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_5/fields/wysiwyg.php';
35
36
+ acf()->fields->register_field_type(new acf_qtranslate_acf_5_text($this->plugin));
37
+ acf()->fields->register_field_type(new acf_qtranslate_acf_5_textarea($this->plugin));
38
+ acf()->fields->register_field_type(new acf_qtranslate_acf_5_wysiwyg($this->plugin));
39
+ acf()->fields->register_field_type(new acf_qtranslate_acf_5_image($this->plugin));
40
+ acf()->fields->register_field_type(new acf_qtranslate_acf_5_file($this->plugin));
41
}
42
43
/**
src/acf_5/fields/file.php CHANGED
@@ -200,9 +200,22 @@ class acf_qtranslate_acf_5_file extends acf_field_file {
200
*
201
* @return $value - the modified value
202
*/
203
- function update_value($value, $post_id, $field) {
204
- $value = parent::update_value($value, $post_id, $field);
205
- return qtrans_join($value);
206
}
207
208
}
200
*
201
* @return $value - the modified value
202
*/
203
+ function update_value($values, $post_id, $field) {
204
+
205
+ // validate
206
+ if ( !is_array($values) ) return false;
207
+
208
+ foreach ($values as $value) {
209
+
210
+ // bail early if not attachment ID
211
+ if( !$value || !is_numeric($value) ) continue;
212
+
213
+ // maybe connect attacments to post
214
+ acf_connect_attachment_to_post( (int) $value, $post_id );
215
+
216
+ }
217
+
218
+ return qtrans_join($values);
219
}
220
221
}
src/acf_5/fields/image.php CHANGED
@@ -186,8 +186,23 @@ class acf_qtranslate_acf_5_image extends acf_field_image {
186
* @return $value - the modified value
187
*/
188
function update_value($value, $post_id, $field) {
189
- $value = parent::update_value($value, $post_id, $field);
190
- return qtrans_join($value);
191
}
192
193
}
186
* @return $value - the modified value
187
*/
188
function update_value($value, $post_id, $field) {
189
+ return acf_get_field_type('qtranslate_file')->update_value( $value, $post_id, $field );
190
+ }
191
+
192
+ /*
193
+ * validate_value
194
+ *
195
+ * This function will validate a basic file input
196
+ *
197
+ * @type function
198
+ * @date 11/02/2014
199
+ * @since 5.0.0
200
+ *
201
+ * @param $post_id (int)
202
+ * @return $post_id (int)
203
+ */
204
+ function validate_value( $valid, $value, $field, $input ){
205
+ return acf_get_field_type('qtranslate_file')->validate_value( $valid, $value, $field, $input );
206
}
207
208
}