ACF qTranslate - Version 1.7.21

Version Description

  • Bug Fix: Make compatible with older versions of ACF5 by checking for acf_connect_attachment_to_post
Download this release

Release Info

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

Code changes from version 1.7.20 to 1.7.21

Files changed (3) hide show
  1. acf-qtranslate.php +1 -1
  2. readme.txt +5 -2
  3. src/acf_5/fields/file.php +7 -5
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.20
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.21
7
  Author: funkjedi
8
  Author URI: http://funkjedi.com
9
  License: GPLv2 or later
readme.txt CHANGED
@@ -3,8 +3,8 @@ 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.20
7
- Stable tag: 1.7.20
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.20 =
58
  * Core: Added ability to display LSBs on specific pages
59
 
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.21
7
+ Stable tag: 1.7.21
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.21 =
58
+ * Bug Fix: Make compatible with older versions of ACF5 by checking for `acf_connect_attachment_to_post`
59
+
60
  = 1.7.20 =
61
  * Core: Added ability to display LSBs on specific pages
62
 
src/acf_5/fields/file.php CHANGED
@@ -205,14 +205,16 @@ class acf_qtranslate_acf_5_file extends acf_field_file {
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);
205
  // validate
206
  if ( !is_array($values) ) return false;
207
 
208
+ if (function_exists('acf_connect_attachment_to_post')) {
209
+ foreach ($values as $value) {
210
 
211
+ // bail early if not attachment ID
212
+ if( !$value || !is_numeric($value) ) continue;
213
 
214
+ // maybe connect attacments to post
215
+ acf_connect_attachment_to_post( (int) $value, $post_id );
216
 
217
+ }
218
  }
219
 
220
  return qtrans_join($values);