WPGlobus – Multilingual Everything! - Version 2.3.7

Version Description

  • (Core/Builders) Fixed PHP Warning "The first argument should be either a string or an integer" in the array_key_exists function.
  • (Vendor/Acf) Code clean-up.
Download this release

Release Info

Developer tivnet
Plugin Icon 128x128 WPGlobus – Multilingual Everything!
Version 2.3.7
Comparing to
See all releases

Code changes from version 2.3.6 to 2.3.7

data/wpglobus-product-info.json CHANGED
@@ -1 +1 @@
1
- {"multilingual-woocommerce-nets-netaxept":{"title":"{:en}Multilingual WooCommerce Nets Netaxept{:}{:ru}\u041c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce Nets Netaxept{:}","_api_new_version":"1.0.3","_api_tested_up_to":"4.9.8"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"1.2.0","_api_tested_up_to":"4.9.6"},"wpglobus-multi-currency":{"title":"{:en}WPGlobus Multi-Currency for WooCommerce{:}{:ru}WPGlobus - \u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0430\u043b\u044e\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce{:}","_api_new_version":"1.1.1","_api_tested_up_to":"4.9.4"},"wpglobus-language-widgets":{"title":"{:en}WPGlobus Language Widgets{:}{:ru}\u042f\u0437\u044b\u043a\u0438 WPGlobus \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432{:}","_api_new_version":"1.1.0","_api_tested_up_to":"4.9.8"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.0.0","_api_tested_up_to":"5.0.4"},"wpglobus-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.0.0","_api_tested_up_to":"5.2"},"wpglobus-for-bridge-theme":{"title":"{:en}WPGlobus for the \"Bridge\" theme{:}{:ru}WPGlobus \u0434\u043b\u044f \u0442\u0435\u043c\u044b Bridge{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.2"},"wpglobus-multilingual-notices":{"title":"{:en}WPGlobus Multilingual Notices{:}{:ru}WPGlobus - \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f{:}","_api_new_version":"2.0.0","_api_tested_up_to":"5.3"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.3.7","_api_tested_up_to":"5.3.2"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"3.5.7","_api_tested_up_to":"5.3.2"}}
1
+ {"multilingual-woocommerce-nets-netaxept":{"title":"{:en}Multilingual WooCommerce Nets Netaxept{:}{:ru}\u041c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce Nets Netaxept{:}","_api_new_version":"1.0.3","_api_tested_up_to":"4.9.8"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"1.2.0","_api_tested_up_to":"4.9.6"},"wpglobus-multi-currency":{"title":"{:en}WPGlobus Multi-Currency for WooCommerce{:}{:ru}WPGlobus - \u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0430\u043b\u044e\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce{:}","_api_new_version":"1.1.1","_api_tested_up_to":"4.9.4"},"wpglobus-language-widgets":{"title":"{:en}WPGlobus Language Widgets{:}{:ru}\u042f\u0437\u044b\u043a\u0438 WPGlobus \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432{:}","_api_new_version":"1.1.0","_api_tested_up_to":"4.9.8"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.0.0","_api_tested_up_to":"5.0.4"},"wpglobus-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.0.0","_api_tested_up_to":"5.2"},"wpglobus-for-bridge-theme":{"title":"{:en}WPGlobus for the \"Bridge\" theme{:}{:ru}WPGlobus \u0434\u043b\u044f \u0442\u0435\u043c\u044b Bridge{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.2"},"wpglobus-multilingual-notices":{"title":"{:en}WPGlobus Multilingual Notices{:}{:ru}WPGlobus - \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f{:}","_api_new_version":"2.0.0","_api_tested_up_to":"5.3"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.3.8","_api_tested_up_to":"5.4.0"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"3.5.11","_api_tested_up_to":"5.4.0"}}
includes/builders/class-wpglobus-builders.php CHANGED
@@ -1403,6 +1403,12 @@ if ( ! class_exists( 'WPGlobus_Builders' ) ) :
1403
  // post.php page.
1404
  if ( isset( $_GET['post'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
1405
  $post_id = $_GET['post']; // phpcs:ignore WordPress.CSRF.NonceVerification
 
 
 
 
 
 
1406
  } else if ( isset( $_REQUEST['post_ID'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
1407
  /**
1408
  * Case when Update button was clicked.
1403
  // post.php page.
1404
  if ( isset( $_GET['post'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
1405
  $post_id = $_GET['post']; // phpcs:ignore WordPress.CSRF.NonceVerification
1406
+ } else if ( isset( $_GET['post_id'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
1407
+ /**
1408
+ * For example when loading WPBakery PB's front editor.
1409
+ * @since 2.3.7
1410
+ */
1411
+ $post_id = $_GET['post_id']; // phpcs:ignore WordPress.CSRF.NonceVerification
1412
  } else if ( isset( $_REQUEST['post_ID'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
1413
  /**
1414
  * Case when Update button was clicked.
includes/vendor/acf/class-wpglobus-acf.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * @package WPGlobus\Vendor\ACF.
4
  *
5
- * @since 1.9.17
6
  */
7
 
8
  /**
@@ -24,8 +24,7 @@ class WPGlobus_Acf_2 {
24
  /**
25
  * Constructor.
26
  */
27
- protected function __construct() {
28
- }
29
 
30
  /**
31
  * Get instance of this class.
@@ -36,7 +35,6 @@ class WPGlobus_Acf_2 {
36
  if ( ! ( self::$instance instanceof WPGlobus_Acf_2 ) ) {
37
  self::$instance = new self();
38
  }
39
-
40
  return self::$instance;
41
  }
42
 
@@ -47,7 +45,6 @@ class WPGlobus_Acf_2 {
47
  if ( is_null( self::$post_multilingual_fields ) ) {
48
  return false;
49
  }
50
-
51
  return self::$post_multilingual_fields;
52
  }
53
 
@@ -182,212 +179,6 @@ class WPGlobus_Acf_2 {
182
  return $_post_meta_fields;
183
  }
184
 
185
- /**
186
- * Get post meta.
187
- *
188
- * Don't use get_field_objects() to get ACF fields @see advanced-custom-fields\includes\api\api-template.php
189
- * to prevent incorrect behavior on post page.
190
- * Don't call WPGlobus::Config() inside function to prevent the resetting of `meta` property.
191
- *
192
- * @param $post_id
193
- * @param string $post_type @since 2.1.3
194
- *
195
- * @return array
196
- */
197
- public static function get_post_meta_fields_1( $post_id, $post_type = 'post' ) {
198
-
199
- if ( in_array( $post_type, array( 'acf-field-group', 'acf-field' ) ) ) {
200
- /**
201
- * Prevent working with own post type.
202
- */
203
- return array();
204
- }
205
-
206
- global $wpdb;
207
-
208
- $_post_meta_fields = array();
209
- $_post_meta_fields_temp = array();
210
-
211
- $post_id = (int) $post_id;
212
-
213
- if ( $post_id > 0 ) {
214
-
215
- $info = acf_get_post_id_info( $post_id );
216
-
217
- if ( $info['type'] == 'post' ) {
218
-
219
- /**
220
- * @todo Check the case when DB has many records with 'acf-field' post type.
221
- */
222
- $fields = $wpdb->get_results( $wpdb->prepare(
223
- "SELECT ID, post_excerpt, post_name, post_parent FROM $wpdb->posts WHERE post_type = '%s'",
224
- 'acf-field'
225
- ) );
226
-
227
- if ( ! empty( $fields ) ) {
228
-
229
- /**
230
- * Filter to enable/disable wysiwyg field.
231
- * Returning boolean.
232
- *
233
- * @since 1.9.17
234
- *
235
- * @param boolean.
236
- */
237
- $field_wysiwyg_enabled = apply_filters( 'wpglobus/vendor/acf/field/wysiwyg', false );
238
-
239
- self::$post_multilingual_fields = array();
240
-
241
- $repeaters = array();
242
-
243
- foreach ( $fields as $key => $field ) :
244
-
245
- /**
246
- * Because incorrect behaviour don't use
247
- * $_acf_field = acf_maybe_get_field( $field->post_name, $post_id );
248
- * and
249
- * $_acf_field = acf_get_field($field->post_name);
250
- */
251
- $_acf_field = _acf_get_field_by_key( $field->post_name );
252
-
253
- if ( empty( $_acf_field['type'] ) ) {
254
- continue;
255
- }
256
-
257
- if ( 'wysiwyg' == $_acf_field['type'] && ! $field_wysiwyg_enabled ) {
258
- /**
259
- * do nothing.
260
- */
261
- } elseif ( 'repeater' == $_acf_field['type'] ) {
262
- /**
263
- * Get repeater to process it later.
264
- */
265
- $repeaters[ $_acf_field['name'] ] = $_acf_field;
266
- } else {
267
-
268
- $_post_meta_fields_temp[ $field->post_excerpt ] = $field->post_excerpt;
269
- self::$post_multilingual_fields[] = self::$post_acf_field_prefix . $field->post_name;
270
-
271
- }
272
- self::$acf_fields[ $field->post_excerpt ] = $_acf_field;
273
-
274
- endforeach;
275
-
276
- if ( empty( $repeaters ) ) {
277
-
278
- $_post_meta_fields = $_post_meta_fields_temp;
279
-
280
- } else {
281
-
282
- $meta_data = get_metadata( 'post', $post_id );
283
-
284
- foreach ( $repeaters as $key => $repeater ) :
285
-
286
- /**
287
- * Get fields that the repeater contains.
288
- *
289
- * @see advanced-custom-fields\includes\api\api-field.php
290
- * @see advanced-custom-fields-pro\includes\api\api-field.php
291
- */
292
- $repeater_fields = acf_get_fields_by_id( $repeater['ID'] );
293
-
294
- if ( ! empty( $repeater_fields ) ) {
295
-
296
- foreach ( $repeater_fields as $_key => $_field ) {
297
-
298
- /**
299
- * Unset unneeded field.
300
- */
301
- unset( $_post_meta_fields_temp[ $_field['name'] ] );
302
-
303
- foreach ( $meta_data as $meta => $data ) {
304
-
305
- if ( 0 == strpos( $meta, $repeater['name'] ) && false !== strpos( $meta, $_field['name'] ) ) {
306
- $_post_meta_fields_temp[ $meta ] = $meta;
307
-
308
- /**
309
- * @todo W.I.P.
310
- */
311
- //self::$acf_fields[ $_field['name'] ]['wpglobus'] = array();
312
-
313
- $_key = str_replace( array(
314
- $repeater['name'] . '_',
315
- '_' . $_field['name'],
316
- ), '', $meta );
317
- self::$post_multilingual_fields[] = self::$post_acf_field_prefix . $repeater['key'] . '-' . $_key . '-' . $_field['key'];
318
- }
319
- }
320
- }
321
- }
322
-
323
- endforeach;
324
-
325
- $_post_meta_fields = $_post_meta_fields_temp;
326
-
327
- }
328
- }
329
- }
330
- }
331
-
332
- return $_post_meta_fields;
333
-
334
- }
335
-
336
- /**
337
- * Get post meta.
338
- *
339
- * Version 0.
340
- * Don't use get_field_objects() to get ACF fields @see advanced-custom-fields\includes\api\api-template.php
341
- * to prevent incorrect behavior on post page.
342
- */
343
- public static function get_post_meta_fields_0( $post_id ) {
344
-
345
- global $wpdb;
346
-
347
- $_post_meta_fields = array();
348
-
349
- $post_id = (int) $post_id;
350
-
351
- if ( $post_id > 0 ) {
352
-
353
- $rows = $wpdb->get_results( $wpdb->prepare(
354
- "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_value LIKE 'field_%'",
355
- $post_id
356
- ), ARRAY_A );
357
-
358
- if ( ! empty( $rows ) ) {
359
-
360
- /**
361
- * Filter to enable/disable wysiwyg field.
362
- * Returning boolean.
363
- *
364
- * @since 1.9.17
365
- *
366
- * @param boolean.
367
- */
368
- $field_wysiwyg_enabled = apply_filters( 'wpglobus/vendor/acf/field/wysiwyg', false );
369
-
370
- self::$post_multilingual_fields = array();
371
- foreach ( $rows as $key => $field ) {
372
- if ( '_' == $field['meta_key'][0] ) {
373
-
374
- $_acf_field = acf_maybe_get_field( $field['meta_value'] );
375
-
376
- if ( $_acf_field['type'] == 'wysiwyg' && ! $field_wysiwyg_enabled ) {
377
- // do nothing.
378
- } else {
379
- $_post_meta_fields[] = substr_replace( $field['meta_key'], '', 0, 1 );
380
- self::$post_multilingual_fields[] = self::$post_acf_field_prefix . $field['meta_value'];
381
- }
382
- }
383
- }
384
- }
385
- }
386
-
387
- return $_post_meta_fields;
388
-
389
- }
390
-
391
  /**
392
  * @since 2.1.11
393
  *
@@ -456,7 +247,6 @@ class WPGlobus_Acf_2 {
456
 
457
  // return
458
  return self::_acf_get_field_by_id( $post_id, $db_only );
459
-
460
  }
461
 
462
  /**
@@ -510,7 +300,6 @@ class WPGlobus_Acf_2 {
510
 
511
  // return
512
  return $field;
513
-
514
  }
515
 
516
  /**
@@ -549,7 +338,7 @@ class WPGlobus_Acf_2 {
549
 
550
  // return
551
  return $posts[0]->ID;
552
-
553
  }
554
-
555
  }
 
 
2
  /**
3
  * @package WPGlobus\Vendor\ACF.
4
  *
5
+ * @since 1.9.17
6
  */
7
 
8
  /**
24
  /**
25
  * Constructor.
26
  */
27
+ protected function __construct() {}
 
28
 
29
  /**
30
  * Get instance of this class.
35
  if ( ! ( self::$instance instanceof WPGlobus_Acf_2 ) ) {
36
  self::$instance = new self();
37
  }
 
38
  return self::$instance;
39
  }
40
 
45
  if ( is_null( self::$post_multilingual_fields ) ) {
46
  return false;
47
  }
 
48
  return self::$post_multilingual_fields;
49
  }
50
 
179
  return $_post_meta_fields;
180
  }
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  /**
183
  * @since 2.1.11
184
  *
247
 
248
  // return
249
  return self::_acf_get_field_by_id( $post_id, $db_only );
 
250
  }
251
 
252
  /**
300
 
301
  // return
302
  return $field;
 
303
  }
304
 
305
  /**
338
 
339
  // return
340
  return $posts[0]->ID;
 
341
  }
 
342
  }
343
+
344
+ # --- EOF
languages/wpglobus.pot CHANGED
@@ -1,8 +1,8 @@
1
- # Copyright (C) 2020 WPGlobus 2.3.6
2
- # This file is distributed under the same license as the WPGlobus 2.3.6 package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WPGlobus 2.3.6\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
1
+ # Copyright (C) 2020 WPGlobus 2.3.7
2
+ # This file is distributed under the same license as the WPGlobus 2.3.7 package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WPGlobus 2.3.7\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: tivnetinc, alexgff, tivnet
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SLF8M4YNZHNQN
4
  Tags: WPGlobus, localization, multilanguage, multilingual, translate
5
  Requires at least: 5.0
6
- Tested up to: 5.3
7
  Requires PHP: 5.6
8
  Stable tag: trunk
9
  License: GPL-3.0-or-later
@@ -218,6 +218,11 @@ WPGlobus Version 2 supports WordPress 5.x, with Gutenberg.
218
 
219
  == Changelog ==
220
 
 
 
 
 
 
221
  = 2.3.6 =
222
 
223
  * (Builders/Elementor) Prevent `The preview could not be loaded` for language in draft status.
@@ -240,11 +245,6 @@ WPGlobus Version 2 supports WordPress 5.x, with Gutenberg.
240
 
241
  * Added: (Core/Post Types) `wpglobus_hidden_types` filter.
242
 
243
- = 2.3.1 =
244
-
245
- * Added: (Core/Post Types) post types of `Elementor Pro` to the hidden types array.
246
- * Added: (Core/WPGlobusDialogApp) `afterOpen` callback.
247
-
248
  = Earlier versions and Add-ons =
249
 
250
  * [See the complete changelog here](https://github.com/WPGlobus/WPGlobus/blob/master/CHANGELOG.md)
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SLF8M4YNZHNQN
4
  Tags: WPGlobus, localization, multilanguage, multilingual, translate
5
  Requires at least: 5.0
6
+ Tested up to: 5.4
7
  Requires PHP: 5.6
8
  Stable tag: trunk
9
  License: GPL-3.0-or-later
218
 
219
  == Changelog ==
220
 
221
+ = 2.3.7 =
222
+
223
+ * (Core/Builders) Fixed PHP Warning "The first argument should be either a string or an integer" in the `array_key_exists` function.
224
+ * (Vendor/Acf) Code clean-up.
225
+
226
  = 2.3.6 =
227
 
228
  * (Builders/Elementor) Prevent `The preview could not be loaded` for language in draft status.
245
 
246
  * Added: (Core/Post Types) `wpglobus_hidden_types` filter.
247
 
 
 
 
 
 
248
  = Earlier versions and Add-ons =
249
 
250
  * [See the complete changelog here](https://github.com/WPGlobus/WPGlobus/blob/master/CHANGELOG.md)
wpglobus.php CHANGED
@@ -15,7 +15,7 @@
15
  * Description: A WordPress Globalization / Multilingual Plugin. Posts, pages, menus, widgets and even custom fields - in multiple languages!
16
  * Text Domain: wpglobus
17
  * Domain Path: /languages/
18
- * Version: 2.3.6
19
  * Author: WPGlobus
20
  * Author URI: https://wpglobus.com/
21
  * Network: false
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
42
  exit;
43
  }
44
 
45
- define( 'WPGLOBUS_VERSION', '2.3.6' );
46
  define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
47
  define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
48
 
15
  * Description: A WordPress Globalization / Multilingual Plugin. Posts, pages, menus, widgets and even custom fields - in multiple languages!
16
  * Text Domain: wpglobus
17
  * Domain Path: /languages/
18
+ * Version: 2.3.7
19
  * Author: WPGlobus
20
  * Author URI: https://wpglobus.com/
21
  * Network: false
42
  exit;
43
  }
44
 
45
+ define( 'WPGLOBUS_VERSION', '2.3.7' );
46
  define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
47
  define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
48