Version Description
- Bug Fix: Added ACF 5.6 compatibility
Download this release
Release Info
Developer | funkjedi |
Plugin | ACF qTranslate |
Version | 1.7.23 |
Comparing to | |
See all releases |
Code changes from version 1.7.22 to 1.7.23
- acf-qtranslate.php +1 -1
- readme.txt +5 -2
- src/acf_5/fields/file.php +33 -12
- src/acf_5/fields/image.php +41 -19
- src/acf_5/fields/text.php +27 -8
- src/acf_5/fields/textarea.php +27 -8
- src/acf_5/fields/wysiwyg.php +26 -4
- src/plugin.php +10 -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.7.
|
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.23
|
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.
|
7 |
-
Stable tag: 1.7.
|
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.22 =
|
58 |
* Bug Fix: Prevent LSBs from loading on all pages by default
|
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.23
|
7 |
+
Stable tag: 1.7.23
|
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.23 =
|
58 |
+
* Bug Fix: Added ACF 5.6 compatibility
|
59 |
+
|
60 |
= 1.7.22 =
|
61 |
* Bug Fix: Prevent LSBs from loading on all pages by default
|
62 |
|
src/acf_5/fields/file.php
CHANGED
@@ -24,28 +24,49 @@ class acf_qtranslate_acf_5_file extends acf_field_file {
|
|
24 |
function __construct($plugin) {
|
25 |
$this->plugin = $plugin;
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
$this->name = 'qtranslate_file';
|
28 |
-
$this->label = __("File",
|
29 |
$this->category = __("qTranslate", 'acf');
|
30 |
$this->defaults = array(
|
31 |
-
'return_format'
|
32 |
-
'library'
|
33 |
-
'min_size'
|
34 |
-
'max_size'
|
35 |
-
'mime_types'
|
36 |
);
|
37 |
-
$this->l10n
|
38 |
-
'select'
|
39 |
-
'edit'
|
40 |
-
'update'
|
41 |
-
'uploadedTo'
|
42 |
);
|
43 |
|
44 |
|
45 |
// filters
|
46 |
add_filter('get_media_item_args', array($this, 'get_media_item_args'));
|
47 |
|
48 |
-
acf_field::__construct();
|
49 |
}
|
50 |
|
51 |
/*
|
24 |
function __construct($plugin) {
|
25 |
$this->plugin = $plugin;
|
26 |
|
27 |
+
if (version_compare($plugin->acf_version(), '5.6.0') < 0) {
|
28 |
+
$this->initialize();
|
29 |
+
}
|
30 |
+
|
31 |
+
acf_field::__construct();
|
32 |
+
}
|
33 |
+
|
34 |
+
/*
|
35 |
+
* __construct
|
36 |
+
*
|
37 |
+
* This function will setup the field type data
|
38 |
+
*
|
39 |
+
* @type function
|
40 |
+
* @date 5/03/2014
|
41 |
+
* @since 5.0.0
|
42 |
+
*
|
43 |
+
* @param n/a
|
44 |
+
* @return n/a
|
45 |
+
*/
|
46 |
+
function initialize() {
|
47 |
+
|
48 |
+
// vars
|
49 |
$this->name = 'qtranslate_file';
|
50 |
+
$this->label = __("File",'acf');
|
51 |
$this->category = __("qTranslate", 'acf');
|
52 |
$this->defaults = array(
|
53 |
+
'return_format' => 'array',
|
54 |
+
'library' => 'all',
|
55 |
+
'min_size' => 0,
|
56 |
+
'max_size' => 0,
|
57 |
+
'mime_types' => ''
|
58 |
);
|
59 |
+
$this->l10n = array(
|
60 |
+
'select' => __("Select File",'acf'),
|
61 |
+
'edit' => __("Edit File",'acf'),
|
62 |
+
'update' => __("Update File",'acf'),
|
63 |
+
'uploadedTo' => __("Uploaded to this post",'acf'),
|
64 |
);
|
65 |
|
66 |
|
67 |
// filters
|
68 |
add_filter('get_media_item_args', array($this, 'get_media_item_args'));
|
69 |
|
|
|
70 |
}
|
71 |
|
72 |
/*
|
src/acf_5/fields/image.php
CHANGED
@@ -23,35 +23,57 @@ class acf_qtranslate_acf_5_image extends acf_field_image {
|
|
23 |
function __construct($plugin) {
|
24 |
$this->plugin = $plugin;
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
$this->name = 'qtranslate_image';
|
27 |
-
$this->label = __("Image",
|
28 |
$this->category = __("qTranslate", 'acf');
|
29 |
$this->defaults = array(
|
30 |
-
'return_format'
|
31 |
-
'preview_size'
|
32 |
-
'library'
|
33 |
-
'min_width'
|
34 |
-
'min_height'
|
35 |
-
'min_size'
|
36 |
-
'max_width'
|
37 |
-
'max_height'
|
38 |
-
'max_size'
|
39 |
-
'mime_types'
|
40 |
);
|
41 |
$this->l10n = array(
|
42 |
-
'select'
|
43 |
-
'edit'
|
44 |
-
'update'
|
45 |
-
'uploadedTo'
|
46 |
-
'all'
|
47 |
);
|
48 |
|
49 |
|
50 |
// filters
|
51 |
-
add_filter('get_media_item_args',
|
52 |
-
add_filter('wp_prepare_attachment_for_js',
|
53 |
|
54 |
-
acf_field::__construct();
|
55 |
}
|
56 |
|
57 |
/*
|
23 |
function __construct($plugin) {
|
24 |
$this->plugin = $plugin;
|
25 |
|
26 |
+
if (version_compare($plugin->acf_version(), '5.6.0') < 0) {
|
27 |
+
$this->initialize();
|
28 |
+
}
|
29 |
+
|
30 |
+
acf_field::__construct();
|
31 |
+
}
|
32 |
+
|
33 |
+
/*
|
34 |
+
* __construct
|
35 |
+
*
|
36 |
+
* This function will setup the field type data
|
37 |
+
*
|
38 |
+
* @type function
|
39 |
+
* @date 5/03/2014
|
40 |
+
* @since 5.0.0
|
41 |
+
*
|
42 |
+
* @param n/a
|
43 |
+
* @return n/a
|
44 |
+
*/
|
45 |
+
|
46 |
+
function initialize() {
|
47 |
+
|
48 |
+
// vars
|
49 |
$this->name = 'qtranslate_image';
|
50 |
+
$this->label = __("Image",'acf');
|
51 |
$this->category = __("qTranslate", 'acf');
|
52 |
$this->defaults = array(
|
53 |
+
'return_format' => 'array',
|
54 |
+
'preview_size' => 'thumbnail',
|
55 |
+
'library' => 'all',
|
56 |
+
'min_width' => 0,
|
57 |
+
'min_height' => 0,
|
58 |
+
'min_size' => 0,
|
59 |
+
'max_width' => 0,
|
60 |
+
'max_height' => 0,
|
61 |
+
'max_size' => 0,
|
62 |
+
'mime_types' => ''
|
63 |
);
|
64 |
$this->l10n = array(
|
65 |
+
'select' => __("Select Image",'acf'),
|
66 |
+
'edit' => __("Edit Image",'acf'),
|
67 |
+
'update' => __("Update Image",'acf'),
|
68 |
+
'uploadedTo' => __("Uploaded to this post",'acf'),
|
69 |
+
'all' => __("All images",'acf'),
|
70 |
);
|
71 |
|
72 |
|
73 |
// filters
|
74 |
+
add_filter('get_media_item_args', array($this, 'get_media_item_args'));
|
75 |
+
add_filter('wp_prepare_attachment_for_js', array($this, 'wp_prepare_attachment_for_js'), 10, 3);
|
76 |
|
|
|
77 |
}
|
78 |
|
79 |
/*
|
src/acf_5/fields/text.php
CHANGED
@@ -24,20 +24,39 @@ class acf_qtranslate_acf_5_text extends acf_field_text {
|
|
24 |
function __construct($plugin) {
|
25 |
$this->plugin = $plugin;
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
$this->name = 'qtranslate_text';
|
28 |
$this->label = __("Text",'acf');
|
29 |
$this->category = __("qTranslate",'acf');
|
30 |
$this->defaults = array(
|
31 |
-
'default_value'
|
32 |
-
'maxlength'
|
33 |
-
'placeholder'
|
34 |
-
'prepend'
|
35 |
-
'append'
|
36 |
-
'readonly' => 0,
|
37 |
-
'disabled' => 0,
|
38 |
);
|
39 |
|
40 |
-
acf_field::__construct();
|
41 |
}
|
42 |
|
43 |
/*
|
24 |
function __construct($plugin) {
|
25 |
$this->plugin = $plugin;
|
26 |
|
27 |
+
if (version_compare($plugin->acf_version(), '5.6.0') < 0) {
|
28 |
+
$this->initialize();
|
29 |
+
}
|
30 |
+
|
31 |
+
acf_field::__construct();
|
32 |
+
}
|
33 |
+
|
34 |
+
/*
|
35 |
+
* initialize
|
36 |
+
*
|
37 |
+
* This function will setup the field type data
|
38 |
+
*
|
39 |
+
* @type function
|
40 |
+
* @date 5/03/2014
|
41 |
+
* @since 5.0.0
|
42 |
+
*
|
43 |
+
* @param n/a
|
44 |
+
* @return n/a
|
45 |
+
*/
|
46 |
+
function initialize() {
|
47 |
+
|
48 |
+
// vars
|
49 |
$this->name = 'qtranslate_text';
|
50 |
$this->label = __("Text",'acf');
|
51 |
$this->category = __("qTranslate",'acf');
|
52 |
$this->defaults = array(
|
53 |
+
'default_value' => '',
|
54 |
+
'maxlength' => '',
|
55 |
+
'placeholder' => '',
|
56 |
+
'prepend' => '',
|
57 |
+
'append' => ''
|
|
|
|
|
58 |
);
|
59 |
|
|
|
60 |
}
|
61 |
|
62 |
/*
|
src/acf_5/fields/textarea.php
CHANGED
@@ -24,20 +24,39 @@ class acf_qtranslate_acf_5_textarea extends acf_field_textarea {
|
|
24 |
function __construct($plugin) {
|
25 |
$this->plugin = $plugin;
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
$this->name = 'qtranslate_textarea';
|
28 |
$this->label = __("Text Area",'acf');
|
29 |
$this->category = __("qTranslate",'acf');
|
30 |
$this->defaults = array(
|
31 |
-
'default_value'
|
32 |
-
'new_lines'
|
33 |
-
'maxlength'
|
34 |
-
'placeholder'
|
35 |
-
'
|
36 |
-
'disabled' => 0,
|
37 |
-
'rows' => ''
|
38 |
);
|
39 |
|
40 |
-
acf_field::__construct();
|
41 |
}
|
42 |
|
43 |
/*
|
24 |
function __construct($plugin) {
|
25 |
$this->plugin = $plugin;
|
26 |
|
27 |
+
if (version_compare($plugin->acf_version(), '5.6.0') < 0) {
|
28 |
+
$this->initialize();
|
29 |
+
}
|
30 |
+
|
31 |
+
acf_field::__construct();
|
32 |
+
}
|
33 |
+
|
34 |
+
/*
|
35 |
+
* initialize
|
36 |
+
*
|
37 |
+
* This function will setup the field type data
|
38 |
+
*
|
39 |
+
* @type function
|
40 |
+
* @date 5/03/2014
|
41 |
+
* @since 5.0.0
|
42 |
+
*
|
43 |
+
* @param n/a
|
44 |
+
* @return n/a
|
45 |
+
*/
|
46 |
+
function initialize() {
|
47 |
+
|
48 |
+
// vars
|
49 |
$this->name = 'qtranslate_textarea';
|
50 |
$this->label = __("Text Area",'acf');
|
51 |
$this->category = __("qTranslate",'acf');
|
52 |
$this->defaults = array(
|
53 |
+
'default_value' => '',
|
54 |
+
'new_lines' => '',
|
55 |
+
'maxlength' => '',
|
56 |
+
'placeholder' => '',
|
57 |
+
'rows' => ''
|
|
|
|
|
58 |
);
|
59 |
|
|
|
60 |
}
|
61 |
|
62 |
/*
|
src/acf_5/fields/wysiwyg.php
CHANGED
@@ -24,6 +24,31 @@ class acf_qtranslate_acf_5_wysiwyg extends acf_field_wysiwyg {
|
|
24 |
function __construct($plugin) {
|
25 |
$this->plugin = $plugin;
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
$this->name = 'qtranslate_wysiwyg';
|
28 |
$this->label = __("Wysiwyg Editor",'acf');
|
29 |
$this->category = __("qTranslate",'acf');
|
@@ -32,6 +57,7 @@ class acf_qtranslate_acf_5_wysiwyg extends acf_field_wysiwyg {
|
|
32 |
'toolbar' => 'full',
|
33 |
'media_upload' => 1,
|
34 |
'default_value' => '',
|
|
|
35 |
);
|
36 |
|
37 |
// add acf_the_content filters
|
@@ -39,10 +65,6 @@ class acf_qtranslate_acf_5_wysiwyg extends acf_field_wysiwyg {
|
|
39 |
$this->add_filters();
|
40 |
}
|
41 |
|
42 |
-
// actions
|
43 |
-
add_action('acf/input/admin_footer', array($this, 'input_admin_footer'));
|
44 |
-
|
45 |
-
acf_field::__construct();
|
46 |
}
|
47 |
|
48 |
/*
|
24 |
function __construct($plugin) {
|
25 |
$this->plugin = $plugin;
|
26 |
|
27 |
+
if (version_compare($plugin->acf_version(), '5.6.0') < 0) {
|
28 |
+
$this->initialize();
|
29 |
+
}
|
30 |
+
|
31 |
+
// actions
|
32 |
+
add_action('acf/input/admin_footer', array($this, 'input_admin_footer'));
|
33 |
+
|
34 |
+
acf_field::__construct();
|
35 |
+
}
|
36 |
+
|
37 |
+
/*
|
38 |
+
* initialize
|
39 |
+
*
|
40 |
+
* This function will setup the field type data
|
41 |
+
*
|
42 |
+
* @type function
|
43 |
+
* @date 5/03/2014
|
44 |
+
* @since 5.0.0
|
45 |
+
*
|
46 |
+
* @param n/a
|
47 |
+
* @return n/a
|
48 |
+
*/
|
49 |
+
function initialize() {
|
50 |
+
|
51 |
+
// vars
|
52 |
$this->name = 'qtranslate_wysiwyg';
|
53 |
$this->label = __("Wysiwyg Editor",'acf');
|
54 |
$this->category = __("qTranslate",'acf');
|
57 |
'toolbar' => 'full',
|
58 |
'media_upload' => 1,
|
59 |
'default_value' => '',
|
60 |
+
'delay' => 0
|
61 |
);
|
62 |
|
63 |
// add acf_the_content filters
|
65 |
$this->add_filters();
|
66 |
}
|
67 |
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
|
70 |
/*
|
src/plugin.php
CHANGED
@@ -66,12 +66,20 @@ class acf_qtranslate_plugin {
|
|
66 |
return false;
|
67 |
}
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
/**
|
70 |
* Return the major version number for Advanced Custom Fields.
|
71 |
* @return int
|
72 |
*/
|
73 |
public function acf_major_version() {
|
74 |
-
return (int)
|
75 |
}
|
76 |
|
77 |
/**
|
@@ -141,7 +149,7 @@ class acf_qtranslate_plugin {
|
|
141 |
public function qtranslate_load_admin_page_config($config)
|
142 |
{
|
143 |
$pages = array(
|
144 |
-
'post.php' => '',
|
145 |
'admin.php' => 'page=',
|
146 |
);
|
147 |
|
66 |
return false;
|
67 |
}
|
68 |
|
69 |
+
/**
|
70 |
+
* Return the major version number for Advanced Custom Fields.
|
71 |
+
* @return int
|
72 |
+
*/
|
73 |
+
public function acf_version() {
|
74 |
+
return acf()->settings['version'];
|
75 |
+
}
|
76 |
+
|
77 |
/**
|
78 |
* Return the major version number for Advanced Custom Fields.
|
79 |
* @return int
|
80 |
*/
|
81 |
public function acf_major_version() {
|
82 |
+
return (int) $this->acf_version();
|
83 |
}
|
84 |
|
85 |
/**
|
149 |
public function qtranslate_load_admin_page_config($config)
|
150 |
{
|
151 |
$pages = array(
|
152 |
+
//'post.php' => '',
|
153 |
'admin.php' => 'page=',
|
154 |
);
|
155 |
|