Version Description
(2018-2-8) =
- Added option to the Preferences page to change the auto updater interval (Thanks to Soluto for contributing this)
- Fixed errors caused by bulk action menus
Download this release
Release Info
Developer | erichie |
Plugin | Lingotek Translation |
Version | 1.3.5 |
Comparing to | |
See all releases |
Code changes from version 1.3.4 to 1.3.5
- admin/admin.php +3 -0
- admin/settings/view-preferences.php +8 -0
- admin/term-actions.php +5 -5
- include/model.php +1 -0
- js/updater.js +24 -20
- lingotek.php +1 -1
- readme.txt +6 -1
admin/admin.php
CHANGED
@@ -207,6 +207,9 @@ class Lingotek_Admin {
|
|
207 |
foreach ( $scripts as $script => $v ) {
|
208 |
if ( in_array( $screen->base, $v[0], true ) ) {
|
209 |
wp_enqueue_script( 'lingotek_' . $script, LINGOTEK_URL . '/js/' . $script . $suffix . '.js', $v[1], LINGOTEK_VERSION, $v[2] );
|
|
|
|
|
|
|
210 |
}
|
211 |
}
|
212 |
|
207 |
foreach ( $scripts as $script => $v ) {
|
208 |
if ( in_array( $screen->base, $v[0], true ) ) {
|
209 |
wp_enqueue_script( 'lingotek_' . $script, LINGOTEK_URL . '/js/' . $script . $suffix . '.js', $v[1], LINGOTEK_VERSION, $v[2] );
|
210 |
+
$lingotek_prefs = get_option( 'lingotek_prefs' );
|
211 |
+
$auto_update_interval = isset($lingotek_prefs['auto_update_status']) ? intval($lingotek_prefs['auto_update_status']) : 10;
|
212 |
+
wp_localize_script( 'lingotek_' . $script, 'updater_data', array('interval' => $auto_update_interval));
|
213 |
}
|
214 |
}
|
215 |
|
admin/settings/view-preferences.php
CHANGED
@@ -39,6 +39,14 @@ $setting_details = array(
|
|
39 |
'enabled' => __( 'Enable importing from Lingotek Content Cloud. (beta)', 'wp-lingotek' ),
|
40 |
),
|
41 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
);
|
43 |
|
44 |
function map_wp_post_status($status){
|
39 |
'enabled' => __( 'Enable importing from Lingotek Content Cloud. (beta)', 'wp-lingotek' ),
|
40 |
),
|
41 |
),
|
42 |
+
'auto_update_status' => array(
|
43 |
+
'type' => 'dropdown',
|
44 |
+
'label' => __( 'Automatic Status Update Interval', 'wp-lingotek' ),
|
45 |
+
'description' => __( 'Changes the rate at which content statuses update automatically.', 'wp-lingotek' ),
|
46 |
+
'values' => array(
|
47 |
+
'10' => '10 seconds', '30' => '30 seconds', '60' => '60 seconds', '-1' => 'Do not update automatically'
|
48 |
+
),
|
49 |
+
),
|
50 |
);
|
51 |
|
52 |
function map_wp_post_status($status){
|
admin/term-actions.php
CHANGED
@@ -19,7 +19,7 @@ class Lingotek_Term_actions extends Lingotek_Actions {
|
|
19 |
foreach ($this->pllm->get_translated_taxonomies() as $taxonomy)
|
20 |
add_filter( $taxonomy . '_row_actions', array(&$this, 'term_row_actions'), 10, 2);
|
21 |
|
22 |
-
add_action('admin_footer-edit-tags.php', array(&$this, 'add_bulk_actions')); // FIXME admin_print_footer_scripts instead?
|
23 |
add_action('load-edit-tags.php', array(&$this, 'manage_actions'));
|
24 |
}
|
25 |
|
@@ -77,10 +77,10 @@ class Lingotek_Term_actions extends Lingotek_Actions {
|
|
77 |
*
|
78 |
* @since 0.1
|
79 |
*/
|
80 |
-
public function add_bulk_actions() {
|
81 |
-
|
82 |
-
|
83 |
-
}
|
84 |
|
85 |
/*
|
86 |
* manages Lingotek specific actions before WordPress acts
|
19 |
foreach ($this->pllm->get_translated_taxonomies() as $taxonomy)
|
20 |
add_filter( $taxonomy . '_row_actions', array(&$this, 'term_row_actions'), 10, 2);
|
21 |
|
22 |
+
// add_action('admin_footer-edit-tags.php', array(&$this, 'add_bulk_actions')); // FIXME admin_print_footer_scripts instead?
|
23 |
add_action('load-edit-tags.php', array(&$this, 'manage_actions'));
|
24 |
}
|
25 |
|
77 |
*
|
78 |
* @since 0.1
|
79 |
*/
|
80 |
+
// public function add_bulk_actions($bulk_actions) {
|
81 |
+
// if ($this->pllm->is_translated_taxonomy($GLOBALS['taxnow']))
|
82 |
+
// $this->_add_bulk_actions($bulk_actions);
|
83 |
+
// }
|
84 |
|
85 |
/*
|
86 |
* manages Lingotek specific actions before WordPress acts
|
include/model.php
CHANGED
@@ -156,6 +156,7 @@ class Lingotek_Model {
|
|
156 |
'delete_linked_content' => array(
|
157 |
'enabled' => 1,
|
158 |
),
|
|
|
159 |
);
|
160 |
$prefs = array_merge($default, get_option('lingotek_prefs', $default)); // ensure defaults are set for missing keys
|
161 |
return $prefs;
|
156 |
'delete_linked_content' => array(
|
157 |
'enabled' => 1,
|
158 |
),
|
159 |
+
'auto_update_status' => '10'
|
160 |
);
|
161 |
$prefs = array_merge($default, get_option('lingotek_prefs', $default)); // ensure defaults are set for missing keys
|
162 |
return $prefs;
|
js/updater.js
CHANGED
@@ -21,27 +21,31 @@ jQuery(document).ready(function($) {
|
|
21 |
tr_id = '#tag-';
|
22 |
object_type = 'term';
|
23 |
}
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
type: 'POST',
|
35 |
-
url: ajax_url,
|
36 |
-
data: post_data,
|
37 |
-
dataType: 'json',
|
38 |
-
success: function (data) {
|
39 |
-
if (data !== null) {
|
40 |
-
update_indicators(data);
|
41 |
}
|
42 |
-
}
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
function update_indicators(data){
|
47 |
ignoreClicks();
|
21 |
tr_id = '#tag-';
|
22 |
object_type = 'term';
|
23 |
}
|
24 |
+
|
25 |
+
var interval = updater_data.interval === undefined ? 10 : updater_data.interval;
|
26 |
+
if (interval > 0) {
|
27 |
+
setInterval(function() {
|
28 |
+
var rows = $('#the-list').find('tr');
|
29 |
+
$(rows).each(function() {
|
30 |
+
if($(this).attr('id') && $(this).attr('id').length > 1) {
|
31 |
+
var id = $(this).attr('id');
|
32 |
+
var object_id = id.replace( /^\D+/g, '');
|
33 |
+
current_ids[object_id] = object_id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
+
});
|
36 |
+
$.ajax({
|
37 |
+
type: 'POST',
|
38 |
+
url: ajax_url,
|
39 |
+
data: post_data,
|
40 |
+
dataType: 'json',
|
41 |
+
success: function (data) {
|
42 |
+
if (data !== null) {
|
43 |
+
update_indicators(data);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
});
|
47 |
+
}, interval * 1000);
|
48 |
+
}
|
49 |
|
50 |
function update_indicators(data){
|
51 |
ignoreClicks();
|
lingotek.php
CHANGED
@@ -16,7 +16,7 @@ if ( ! function_exists( 'add_action' ) ) {
|
|
16 |
exit();
|
17 |
}
|
18 |
|
19 |
-
define( 'LINGOTEK_VERSION', '1.3.
|
20 |
define( 'LINGOTEK_MIN_PLL_VERSION', '1.8' );
|
21 |
define( 'LINGOTEK_BASENAME', plugin_basename( __FILE__ ) ); // plugin name as known by WP.
|
22 |
define( 'LINGOTEK_PLUGIN_SLUG', 'lingotek-translation' );// plugin slug (should match above meta: Text Domain).
|
16 |
exit();
|
17 |
}
|
18 |
|
19 |
+
define( 'LINGOTEK_VERSION', '1.3.5' ); // plugin version (should match above meta).
|
20 |
define( 'LINGOTEK_MIN_PLL_VERSION', '1.8' );
|
21 |
define( 'LINGOTEK_BASENAME', plugin_basename( __FILE__ ) ); // plugin name as known by WP.
|
22 |
define( 'LINGOTEK_PLUGIN_SLUG', 'lingotek-translation' );// plugin slug (should match above meta: Text Domain).
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://lingotek.com/
|
|
4 |
Tags: automation, bilingual, international, language, Lingotek, localization, multilanguage, multilingual, translate, translation
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.9
|
7 |
-
Stable tag: 1.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -122,6 +122,11 @@ For more, visit the [Lingotek documentation site](https://lingotek.atlassian.net
|
|
122 |
|
123 |
== Changelog ==
|
124 |
|
|
|
|
|
|
|
|
|
|
|
125 |
= 1.3.4 (2017-12-1) =
|
126 |
|
127 |
* Updated URLs for redirection to the Lingotek Marketplace and Payment Portal
|
4 |
Tags: automation, bilingual, international, language, Lingotek, localization, multilanguage, multilingual, translate, translation
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.9
|
7 |
+
Stable tag: 1.3.5
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
122 |
|
123 |
== Changelog ==
|
124 |
|
125 |
+
= 1.3.5 (2018-2-8) =
|
126 |
+
|
127 |
+
* Added option to the Preferences page to change the auto updater interval (Thanks to Soluto for contributing this)
|
128 |
+
* Fixed errors caused by bulk action menus
|
129 |
+
|
130 |
= 1.3.4 (2017-12-1) =
|
131 |
|
132 |
* Updated URLs for redirection to the Lingotek Marketplace and Payment Portal
|