ACF qTranslate - Version 1.7.3

Version Description

  • Core: Removed namespaces to make code compatible with PHP 5.2
Download this release

Release Info

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

Code changes from version 1.7.2 to 1.7.3

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.2
7
  Author: funkjedi
8
  Author URI: http://funkjedi.com
9
  License: GPLv2 or later
@@ -13,23 +13,5 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
  define('ACF_QTRANSLATE_PLUGIN', __FILE__);
14
  define('ACF_QTRANSLATE_PLUGIN_DIR', plugin_dir_path(ACF_QTRANSLATE_PLUGIN));
15
 
16
-
17
- /**
18
- * Create autoload to load plugin classes.
19
- */
20
- function acf_qtranslate_autoload($className) {
21
- if (strpos($className, 'acf_qtranslate\\') === 0) {
22
- $path = ACF_QTRANSLATE_PLUGIN_DIR . 'src/' . str_replace('\\', '/', substr($className, 15)) . '.php';
23
- if (is_readable($path)) {
24
- include $path;
25
- }
26
- }
27
- }
28
-
29
- spl_autoload_register('acf_qtranslate_autoload');
30
-
31
-
32
-
33
-
34
- // bootstrap plugin
35
- new acf_qtranslate\plugin;
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.3
7
  Author: funkjedi
8
  Author URI: http://funkjedi.com
9
  License: GPLv2 or later
13
  define('ACF_QTRANSLATE_PLUGIN', __FILE__);
14
  define('ACF_QTRANSLATE_PLUGIN_DIR', plugin_dir_path(ACF_QTRANSLATE_PLUGIN));
15
 
16
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/plugin.php';
17
+ new acf_qtranslate_plugin;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,12 +3,12 @@ Contributors: funkjedi
3
  Tags: acf, advanced custom fields, qtranslate, add-on, admin
4
  Requires at least: 3.5.0
5
  Tested up to: 4.1.1
6
- Version: 1.7.2
7
- Stable tag: 1.7.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Adds qTranslate compatible field types for Text, Text Area, Wysiwyg Editor and Image.
12
 
13
 
14
  == Description ==
@@ -56,6 +56,9 @@ The plugin is based on code samples posted to the ACF support forums by taeo bac
56
 
57
  == Changelog ==
58
 
 
 
 
59
  = 1.7.2 =
60
  * Bug Fix: Corrected misnamed variable
61
  * Bug Fix: ACF5 issues using WYSIWYG with the repeater field type
3
  Tags: acf, advanced custom fields, qtranslate, add-on, admin
4
  Requires at least: 3.5.0
5
  Tested up to: 4.1.1
6
+ Version: 1.7.3
7
+ Stable tag: 1.7.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Provides qTranslate compatible ACF field types for Text, Text Area, WYSIWYG, Image and File.
12
 
13
 
14
  == Description ==
56
 
57
  == Changelog ==
58
 
59
+ = 1.7.3 =
60
+ * Core: Removed namespaces to make code compatible with PHP 5.2
61
+
62
  = 1.7.2 =
63
  * Bug Fix: Corrected misnamed variable
64
  * Bug Fix: ACF5 issues using WYSIWYG with the repeater field type
src/acf_4/acf.php CHANGED
@@ -1,20 +1,12 @@
1
  <?php
2
 
3
- namespace acf_qtranslate\acf_4;
4
 
5
- use acf_qtranslate\acf_4\fields\file;
6
- use acf_qtranslate\acf_4\fields\image;
7
- use acf_qtranslate\acf_4\fields\text;
8
- use acf_qtranslate\acf_4\fields\textarea;
9
- use acf_qtranslate\acf_4\fields\wysiwyg;
10
- use acf_qtranslate\acf_interface;
11
- use acf_qtranslate\plugin;
12
-
13
- class acf implements acf_interface {
14
 
15
  /**
16
  * The plugin instance.
17
- * @var \acf_qtranslate\plugin
18
  */
19
  protected $plugin;
20
 
@@ -37,11 +29,17 @@ class acf implements acf_interface {
37
  * Load javascript and stylesheets on admin pages.
38
  */
39
  public function register_fields() {
40
- new text($this->plugin);
41
- new textarea($this->plugin);
42
- new wysiwyg($this->plugin);
43
- new image($this->plugin);
44
- new file($this->plugin);
 
 
 
 
 
 
45
  }
46
 
47
  /**
1
  <?php
2
 
3
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_interface.php';
4
 
5
+ class acf_qtranslate_acf_4 implements acf_qtranslate_acf_interface {
 
 
 
 
 
 
 
 
6
 
7
  /**
8
  * The plugin instance.
9
+ * @var \acf_qtranslate_plugin
10
  */
11
  protected $plugin;
12
 
29
  * Load javascript and stylesheets on admin pages.
30
  */
31
  public function register_fields() {
32
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_4/fields/file.php';
33
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_4/fields/image.php';
34
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_4/fields/text.php';
35
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_4/fields/textarea.php';
36
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_4/fields/wysiwyg.php';
37
+
38
+ new acf_qtranslate_acf_4_text($this->plugin);
39
+ new acf_qtranslate_acf_4_textarea($this->plugin);
40
+ new acf_qtranslate_acf_4_wysiwyg($this->plugin);
41
+ new acf_qtranslate_acf_4_image($this->plugin);
42
+ new acf_qtranslate_acf_4_file($this->plugin);
43
  }
44
 
45
  /**
src/acf_4/fields/file.php CHANGED
@@ -1,15 +1,10 @@
1
  <?php
2
 
3
- namespace acf_qtranslate\acf_4\fields;
4
-
5
- use acf_field;
6
- use acf_field_file;
7
-
8
- class file extends acf_field_file {
9
 
10
  /**
11
  * The plugin instance.
12
- * @var \acf_qtranslate\plugin
13
  */
14
  protected $plugin;
15
 
1
  <?php
2
 
3
+ class acf_qtranslate_acf_4_file extends acf_field_file {
 
 
 
 
 
4
 
5
  /**
6
  * The plugin instance.
7
+ * @var \acf_qtranslate_plugin
8
  */
9
  protected $plugin;
10
 
src/acf_4/fields/image.php CHANGED
@@ -1,11 +1,6 @@
1
  <?php
2
 
3
- namespace acf_qtranslate\acf_4\fields;
4
-
5
- use acf_field;
6
- use acf_field_image;
7
-
8
- class image extends acf_field_image {
9
 
10
  /**
11
  * The plugin instance.
1
  <?php
2
 
3
+ class acf_qtranslate_acf_4_image extends acf_field_image {
 
 
 
 
 
4
 
5
  /**
6
  * The plugin instance.
src/acf_4/fields/text.php CHANGED
@@ -1,11 +1,6 @@
1
  <?php
2
 
3
- namespace acf_qtranslate\acf_4\fields;
4
-
5
- use acf_field;
6
- use acf_field_text;
7
-
8
- class text extends acf_field_text {
9
 
10
  /**
11
  * The plugin instance.
1
  <?php
2
 
3
+ class acf_qtranslate_acf_4_text extends acf_field_text {
 
 
 
 
 
4
 
5
  /**
6
  * The plugin instance.
src/acf_4/fields/textarea.php CHANGED
@@ -1,15 +1,10 @@
1
  <?php
2
 
3
- namespace acf_qtranslate\acf_4\fields;
4
-
5
- use acf_field;
6
- use acf_field_textarea;
7
-
8
- class textarea extends acf_field_textarea {
9
 
10
  /**
11
  * The plugin instance.
12
- * @var \acf_qtranslate\plugin
13
  */
14
  protected $plugin;
15
 
1
  <?php
2
 
3
+ class acf_qtranslate_acf_4_textarea extends acf_field_textarea {
 
 
 
 
 
4
 
5
  /**
6
  * The plugin instance.
7
+ * @var \acf_qtranslate_plugin
8
  */
9
  protected $plugin;
10
 
src/acf_4/fields/wysiwyg.php CHANGED
@@ -1,15 +1,10 @@
1
  <?php
2
 
3
- namespace acf_qtranslate\acf_4\fields;
4
-
5
- use acf_field;
6
- use acf_field_wysiwyg;
7
-
8
- class wysiwyg extends acf_field_wysiwyg {
9
 
10
  /**
11
  * The plugin instance.
12
- * @var \acf_qtranslate\plugin
13
  */
14
  protected $plugin;
15
 
1
  <?php
2
 
3
+ class acf_qtranslate_acf_4_wysiwyg extends acf_field_wysiwyg {
 
 
 
 
 
4
 
5
  /**
6
  * The plugin instance.
7
+ * @var \acf_qtranslate_plugin
8
  */
9
  protected $plugin;
10
 
src/acf_5/acf.php CHANGED
@@ -1,20 +1,12 @@
1
  <?php
2
 
3
- namespace acf_qtranslate\acf_5;
4
 
5
- use acf_qtranslate\acf_5\fields\image;
6
- use acf_qtranslate\acf_5\fields\file;
7
- use acf_qtranslate\acf_5\fields\text;
8
- use acf_qtranslate\acf_5\fields\textarea;
9
- use acf_qtranslate\acf_5\fields\wysiwyg;
10
- use acf_qtranslate\acf_interface;
11
- use acf_qtranslate\plugin;
12
-
13
- class acf implements acf_interface {
14
 
15
  /**
16
  * The plugin instance.
17
- * @var \acf_qtranslate\plugin
18
  */
19
  protected $plugin;
20
 
@@ -35,11 +27,17 @@ class acf implements acf_interface {
35
  * Load javascript and stylesheets on admin pages.
36
  */
37
  public function include_fields() {
38
- new text($this->plugin);
39
- new textarea($this->plugin);
40
- new wysiwyg($this->plugin);
41
- new image($this->plugin);
42
- new file($this->plugin);
 
 
 
 
 
 
43
  }
44
 
45
  /**
1
  <?php
2
 
3
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_interface.php';
4
 
5
+ class acf_qtranslate_acf_5 implements acf_qtranslate_acf_interface {
 
 
 
 
 
 
 
 
6
 
7
  /**
8
  * The plugin instance.
9
+ * @var \acf_qtranslate_plugin
10
  */
11
  protected $plugin;
12
 
27
  * Load javascript and stylesheets on admin pages.
28
  */
29
  public function include_fields() {
30
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_5/fields/file.php';
31
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_5/fields/image.php';
32
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_5/fields/text.php';
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
  /**
src/acf_5/fields/file.php CHANGED
@@ -1,15 +1,10 @@
1
  <?php
2
 
3
- namespace acf_qtranslate\acf_5\fields;
4
-
5
- use acf_field;
6
- use acf_field_file;
7
-
8
- class file extends acf_field_file {
9
 
10
  /**
11
  * The plugin instance.
12
- * @var \acf_qtranslate\plugin
13
  */
14
  protected $plugin;
15
 
1
  <?php
2
 
3
+ class acf_qtranslate_acf_5_file extends acf_field_file {
 
 
 
 
 
4
 
5
  /**
6
  * The plugin instance.
7
+ * @var \acf_qtranslate_plugin
8
  */
9
  protected $plugin;
10
 
src/acf_5/fields/image.php CHANGED
@@ -1,15 +1,10 @@
1
  <?php
2
 
3
- namespace acf_qtranslate\acf_5\fields;
4
-
5
- use acf_field;
6
- use acf_field_image;
7
-
8
- class image extends acf_field_image {
9
 
10
  /**
11
  * The plugin instance.
12
- * @var \acf_qtranslate\plugin
13
  */
14
  protected $plugin;
15
 
1
  <?php
2
 
3
+ class acf_qtranslate_acf_5_image extends acf_field_image {
 
 
 
 
 
4
 
5
  /**
6
  * The plugin instance.
7
+ * @var \acf_qtranslate_plugin
8
  */
9
  protected $plugin;
10
 
src/acf_5/fields/text.php CHANGED
@@ -1,15 +1,10 @@
1
  <?php
2
 
3
- namespace acf_qtranslate\acf_5\fields;
4
-
5
- use acf_field;
6
- use acf_field_text;
7
-
8
- class text extends acf_field_text {
9
 
10
  /**
11
  * The plugin instance.
12
- * @var \acf_qtranslate\plugin
13
  */
14
  protected $plugin;
15
 
1
  <?php
2
 
3
+ class acf_qtranslate_acf_5_text extends acf_field_text {
 
 
 
 
 
4
 
5
  /**
6
  * The plugin instance.
7
+ * @var \acf_qtranslate_plugin
8
  */
9
  protected $plugin;
10
 
src/acf_5/fields/textarea.php CHANGED
@@ -1,11 +1,6 @@
1
  <?php
2
 
3
- namespace acf_qtranslate\acf_5\fields;
4
-
5
- use acf_field;
6
- use acf_field_textarea;
7
-
8
- class textarea extends acf_field_textarea {
9
 
10
  /**
11
  * The plugin instance.
1
  <?php
2
 
3
+ class acf_qtranslate_acf_5_textarea extends acf_field_textarea {
 
 
 
 
 
4
 
5
  /**
6
  * The plugin instance.
src/acf_5/fields/wysiwyg.php CHANGED
@@ -1,15 +1,10 @@
1
  <?php
2
 
3
- namespace acf_qtranslate\acf_5\fields;
4
-
5
- use acf_field;
6
- use acf_field_wysiwyg;
7
-
8
- class wysiwyg extends acf_field_wysiwyg {
9
 
10
  /**
11
  * The plugin instance.
12
- * @var \acf_qtranslate\plugin
13
  */
14
  protected $plugin;
15
 
1
  <?php
2
 
3
+ class acf_qtranslate_acf_5_wysiwyg extends acf_field_wysiwyg {
 
 
 
 
 
4
 
5
  /**
6
  * The plugin instance.
7
+ * @var \acf_qtranslate_plugin
8
  */
9
  protected $plugin;
10
 
src/acf_interface.php CHANGED
@@ -1,8 +1,6 @@
1
  <?php
2
 
3
- namespace acf_qtranslate;
4
-
5
- interface acf_interface {
6
 
7
  /**
8
  * Get the visible ACF fields.
1
  <?php
2
 
3
+ interface acf_qtranslate_acf_interface {
 
 
4
 
5
  /**
6
  * Get the visible ACF fields.
src/plugin.php CHANGED
@@ -1,11 +1,6 @@
1
  <?php
2
 
3
- namespace acf_qtranslate;
4
-
5
- use acf_qtranslate\acf_4\acf as acf_4;
6
- use acf_qtranslate\acf_5\acf as acf_5;
7
-
8
- class plugin {
9
 
10
  /**
11
  * Create an instance.
@@ -24,22 +19,26 @@ class plugin {
24
 
25
  // setup qtranslate fields for ACF 4
26
  if ($this->acf_major_version() === 4) {
27
- $acf = new acf_4($this);
 
28
  }
29
 
30
  // setup qtranslate fields for ACF 5
31
  if ($this->acf_major_version() === 5) {
32
- $acf = new acf_5($this);
 
33
  }
34
 
35
  // setup ppqtranslate integration
36
  if ($this->ppqtranslate_enabled()) {
37
- new ppqtranslate($this, $acf);
 
38
  }
39
 
40
  // setup qtranslatex integration
41
  if ($this->qtranslatex_enabled()) {
42
- new qtranslatex($this, $acf);
 
43
  }
44
 
45
  }
1
  <?php
2
 
3
+ class acf_qtranslate_plugin {
 
 
 
 
 
4
 
5
  /**
6
  * Create an instance.
19
 
20
  // setup qtranslate fields for ACF 4
21
  if ($this->acf_major_version() === 4) {
22
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_4/acf.php';
23
+ $acf = new acf_qtranslate_acf_4($this);
24
  }
25
 
26
  // setup qtranslate fields for ACF 5
27
  if ($this->acf_major_version() === 5) {
28
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_5/acf.php';
29
+ $acf = new acf_qtranslate_acf_5($this);
30
  }
31
 
32
  // setup ppqtranslate integration
33
  if ($this->ppqtranslate_enabled()) {
34
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/ppqtranslate.php';
35
+ new acf_qtranslate_ppqtranslate($this, $acf);
36
  }
37
 
38
  // setup qtranslatex integration
39
  if ($this->qtranslatex_enabled()) {
40
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/qtranslatex.php';
41
+ new acf_qtranslate_qtranslatex($this, $acf);
42
  }
43
 
44
  }
src/ppqtranslate.php CHANGED
@@ -1,18 +1,18 @@
1
  <?php
2
 
3
- namespace acf_qtranslate;
4
 
5
- class ppqtranslate {
6
 
7
  /**
8
  * An ACF instance.
9
- * @var \acf_qtranslate\acf_interface
10
  */
11
  protected $acf;
12
 
13
  /**
14
  * The plugin instance.
15
- * @var \acf_qtranslate\plugin
16
  */
17
  protected $plugin;
18
 
@@ -21,7 +21,7 @@ class ppqtranslate {
21
  * Create an instance.
22
  * @return void
23
  */
24
- public function __construct(plugin $plugin, acf_interface $acf) {
25
  $this->acf = $acf;
26
  $this->plugin = $plugin;
27
 
1
  <?php
2
 
3
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_interface.php';
4
 
5
+ class acf_qtranslate_ppqtranslate {
6
 
7
  /**
8
  * An ACF instance.
9
+ * @var \acf_qtranslate_acf_interface
10
  */
11
  protected $acf;
12
 
13
  /**
14
  * The plugin instance.
15
+ * @var \acf_qtranslate_plugin
16
  */
17
  protected $plugin;
18
 
21
  * Create an instance.
22
  * @return void
23
  */
24
+ public function __construct(acf_qtranslate_plugin $plugin, acf_qtranslate_acf_interface $acf) {
25
  $this->acf = $acf;
26
  $this->plugin = $plugin;
27
 
src/qtranslatex.php CHANGED
@@ -1,18 +1,18 @@
1
  <?php
2
 
3
- namespace acf_qtranslate;
4
 
5
- class qtranslatex {
6
 
7
  /**
8
  * An ACF instance.
9
- * @var \acf_qtranslate\acf_interface
10
  */
11
  protected $acf;
12
 
13
  /**
14
  * The plugin instance.
15
- * @var \acf_qtranslate\plugin
16
  */
17
  protected $plugin;
18
 
@@ -21,7 +21,7 @@ class qtranslatex {
21
  * Create an instance.
22
  * @return void
23
  */
24
- public function __construct(plugin $plugin, acf_interface $acf) {
25
  $this->acf = $acf;
26
  $this->plugin = $plugin;
27
 
1
  <?php
2
 
3
+ require_once ACF_QTRANSLATE_PLUGIN_DIR . 'src/acf_interface.php';
4
 
5
+ class acf_qtranslate_qtranslatex {
6
 
7
  /**
8
  * An ACF instance.
9
+ * @var \acf_qtranslate_acf_interface
10
  */
11
  protected $acf;
12
 
13
  /**
14
  * The plugin instance.
15
+ * @var \acf_qtranslate_plugin
16
  */
17
  protected $plugin;
18
 
21
  * Create an instance.
22
  * @return void
23
  */
24
+ public function __construct(acf_qtranslate_plugin $plugin, acf_qtranslate_acf_interface $acf) {
25
  $this->acf = $acf;
26
  $this->plugin = $plugin;
27