WPGlobus – Multilingual Everything! - Version 2.10.1

Version Description

  • (Vendor/Yoast) Added filters for the user Open Graph title and description, Schema Graph name and description.
  • (Core) Fixed PHP 8.1 notice about add_submenu_page() parameter.
Download this release

Release Info

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

Code changes from version 2.10.0 to 2.10.1

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-multi-currency":{"title":"{:en}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-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.6"},"wpglobus-for-ultimate-member":{"title":"{:en}WPGlobus for Ultimate Member{:}{:ru}WPGlobus \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Ultimate Member{:}","_api_new_version":"1.1.0","_api_tested_up_to":"5.6"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"2.0.0","_api_tested_up_to":"5.6"},"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.4.0","_api_tested_up_to":"5.5"},"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.9.2","_api_tested_up_to":"5.8"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.8"},"wpglobus-multilingual-popups":{"title":"{:en}WPGlobus Multilingual Popups{:}{:ru}WPGlobus Multilingual Popups{:}","_api_new_version":"1.5.0","_api_tested_up_to":"5.8"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.8.5","_api_tested_up_to":"5.8"},"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":"2.2.0","_api_tested_up_to":"5.9"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"6.1.0","_api_tested_up_to":"6.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-multi-currency":{"title":"{:en}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-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.6"},"wpglobus-for-ultimate-member":{"title":"{:en}WPGlobus for Ultimate Member{:}{:ru}WPGlobus \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Ultimate Member{:}","_api_new_version":"1.1.0","_api_tested_up_to":"5.6"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"2.0.0","_api_tested_up_to":"5.6"},"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.4.0","_api_tested_up_to":"5.5"},"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.9.2","_api_tested_up_to":"5.8"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.8"},"wpglobus-multilingual-popups":{"title":"{:en}WPGlobus Multilingual Popups{:}{:ru}WPGlobus Multilingual Popups{:}","_api_new_version":"1.5.0","_api_tested_up_to":"5.8"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.8.5","_api_tested_up_to":"5.8"},"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":"2.2.0","_api_tested_up_to":"5.9"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"6.2.0","_api_tested_up_to":"6.6.0"}}
includes/admin/central/class-wpglobus-admin-central.php CHANGED
@@ -48,7 +48,7 @@ if ( ! class_exists( 'WPGlobus_Admin_Central' ) ) :
48
  */
49
  public static function add_menu() {
50
  add_submenu_page(
51
- null,
52
  '',
53
  '',
54
  'administrator',
48
  */
49
  public static function add_menu() {
50
  add_submenu_page(
51
+ '',
52
  '',
53
  '',
54
  'administrator',
includes/class-wpglobus.php CHANGED
@@ -66,24 +66,24 @@ class WPGlobus {
66
  /**
67
  * WPGlobus HelpDesk page
68
  *
69
- * @var string
70
  * @since 1.6.5
 
71
  */
72
  const PAGE_WPGLOBUS_HELPDESK = 'wpglobus-helpdesk';
73
 
74
  /**
75
  * WPGlobus Admin Central page
76
  *
77
- * @var string
78
  * @since 1.6.6
 
79
  */
80
  const PAGE_WPGLOBUS_ADMIN_CENTRAL = 'wpglobus-admin-central';
81
-
82
  /**
83
  * WordPress User edit page name.
84
  *
85
  * @since 2.5.3
86
- */
87
  const WP_USER_EDIT_PAGE = 'user-edit.php';
88
 
89
  /**
@@ -146,8 +146,8 @@ class WPGlobus {
146
  /**
147
  * Path to languages folder.
148
  *
149
- * @return string
150
  * @since 1.9.6
 
151
  */
152
  public static function languages_path() {
153
  return self::$PLUGIN_DIR_PATH . 'languages';
@@ -156,8 +156,8 @@ class WPGlobus {
156
  /**
157
  * Get language meta key.
158
  *
159
- * @return string
160
  * @since 1.9.17
 
161
  */
162
  public static function get_language_meta_key() {
163
  return self::LANGUAGE_META_KEY;
@@ -244,10 +244,10 @@ class WPGlobus {
244
  if ( function_exists( 'acf' ) ) {
245
 
246
  /**
247
- * @todo Work on the ACF compatibility is in progress
248
- * Temporarily add CPT acf ( Advanced Custom Fields ) to the array of disabled_entities
249
  * @see 'wpglobus_disabled_entities' filter for add/remove custom post types to array disabled_entities
250
  * @since 1.0.4
 
 
251
  */
252
  global $acf;
253
  if ( ! empty( $acf->settings['pro'] ) && $acf->settings['pro'] ) {
@@ -263,10 +263,10 @@ class WPGlobus {
263
  if ( defined( 'WC_VERSION' ) || defined( 'WOOCOMMERCE_VERSION' ) ) {
264
 
265
  $this->vendors_scripts['WOOCOMMERCE'] = true;
266
-
267
  /**
268
  * @todo May be move to includes\class-wpglobus-post-types.php
269
- */
270
  $this->disabled_entities[] = 'product_tag';
271
  $this->disabled_entities[] = 'product_cat';
272
 
@@ -330,7 +330,7 @@ class WPGlobus {
330
  * @since 2.2.35
331
  */
332
  require_once dirname( __FILE__ ) . '/builders/class-wpglobus-builder-update-post.php';
333
-
334
  require_once dirname( __FILE__ ) . '/builders/gutenberg/class-wpglobus-gutenberg-update-post.php';
335
  new WPGlobus_Gutenberg_Update_Post();
336
 
@@ -346,7 +346,7 @@ class WPGlobus {
346
  * @since 2.2.35
347
  */
348
  require_once dirname( __FILE__ ) . '/builders/class-wpglobus-builder-update-post.php';
349
-
350
  /** @noinspection PhpIncludeInspection */
351
  require_once $_file;
352
  $class_update_post = "WPGlobus_${id}_Update_Post";
@@ -358,8 +358,8 @@ class WPGlobus {
358
  */
359
  if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
360
  $_short_file = 'builders/' . $id . '/class-wpglobus-' . $id . '-update-post.php';
361
- error_log( print_r( '['.basename(__FILE__).']:: File `' . $_short_file . '` was expected in `' . __CLASS__ . '` class.' , true ) );
362
- }
363
  }
364
  }
365
  }
@@ -416,8 +416,8 @@ class WPGlobus {
416
  new WPGlobus_Options();
417
 
418
  /**
419
- * @since 1.9.17
420
  * @see 'post_submitbox_misc_actions'
 
421
  */
422
  add_action( 'post_submitbox_misc_actions', array(
423
  $this,
@@ -425,8 +425,8 @@ class WPGlobus {
425
  ) );
426
 
427
  /**
428
- * @since 2.4.12
429
  * @see 'post_submitbox_misc_actions'
 
430
  */
431
  add_action( 'post_submitbox_misc_actions', array(
432
  $this,
@@ -454,7 +454,7 @@ class WPGlobus {
454
  );
455
  }
456
  }
457
-
458
  /**
459
  * @since 1.9.17
460
  */
@@ -466,7 +466,7 @@ class WPGlobus {
466
  * Let's load all needed vendors.
467
  */
468
  require_once dirname( __FILE__ ) . '/vendor/wpglobus-vendors.php';
469
-
470
  /**
471
  * @since 2.2.22
472
  */
@@ -520,8 +520,9 @@ class WPGlobus {
520
  'on__admin_title',
521
  ), 10, 2 );
522
 
523
- /**
524
  * Moved from below.
 
525
  * @since 2.7.9
526
  */
527
  add_action( 'admin_bar_menu', array(
@@ -562,8 +563,8 @@ class WPGlobus {
562
  */
563
  if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
564
  $_short_file = 'builders/' . self::Config()->builder->get_id() . '/class-wpglobus-' . self::Config()->builder->get_id() . '.php';
565
- error_log( print_r( '['.basename(__FILE__).']:: File `' . $_short_file . '` was expected in `' . __CLASS__ . '` class.' , true ) );
566
- }
567
  }
568
  }
569
  }
@@ -620,14 +621,14 @@ class WPGlobus {
620
  'edit.php',
621
  ) )
622
  ) {
623
-
624
  if ( self::Config()->builder->is_builder_page() ) {
625
  /** Don't run in Builder mode. */
626
- } else {
627
  /**
628
  * Support Standard/Classic mode.
629
  */
630
-
631
  /** @global WP_Post $post */
632
  global $post;
633
 
@@ -637,7 +638,7 @@ class WPGlobus {
637
  }
638
  }
639
  }
640
-
641
  /**
642
  * @since 2.6.6
643
  */
@@ -651,17 +652,17 @@ class WPGlobus {
651
  )
652
  ) {
653
  require_once( 'vendor/acf/class-wpglobus-vendor-acf.php' );
654
- WPGlobus_Vendor_Acf::get_instance(
655
  array(
656
- 'vendor_scripts' => $this->vendors_scripts
657
  )
658
- );
659
  require_once 'vendor/class-wpglobus-acf.php';
660
  $WPGlobus_acf = new WPGlobus_Acf();
661
  }
662
-
663
  /**
664
- * @since 2.2.22
665
  */
666
  require_once 'admin/media/wpglobus-media.php';
667
 
@@ -674,8 +675,8 @@ class WPGlobus {
674
 
675
  // @since 2.7.9 moved above
676
  //add_action( 'admin_bar_menu', array(
677
- //$this,
678
- //'on_admin_bar_menu',
679
  //) );
680
 
681
  /**
@@ -1114,11 +1115,11 @@ class WPGlobus {
1114
  /**
1115
  * Set transient wpglobus_activated after activated plugin @see on_admin_init()
1116
  *
1117
- * @todo use $WPGlobus_Config to determine running this function?
1118
- *
1119
  * @param string $plugin
1120
  *
1121
  * @return void
 
 
1122
  */
1123
  public static function activated( $plugin ) {
1124
  if ( WPGLOBUS_PLUGIN_BASENAME == $plugin ) {
@@ -1213,7 +1214,7 @@ class WPGlobus {
1213
  *
1214
  * @since 2.4.12
1215
  *
1216
- * @return void
1217
  */
1218
  public function on__add_actions() {
1219
 
@@ -1230,7 +1231,7 @@ class WPGlobus {
1230
  if ( $this->disabled_entity( $post->post_type ) ) {
1231
  return;
1232
  }
1233
-
1234
  /**
1235
  * Add switcher to the publish metabox.
1236
  *
@@ -1240,7 +1241,7 @@ class WPGlobus {
1240
  */
1241
  do_action( 'wpglobus_submitbox_action', $post );
1242
  }
1243
-
1244
  /**
1245
  * Add switcher to publish metabox.
1246
  *
@@ -1568,13 +1569,14 @@ class WPGlobus {
1568
  } else {
1569
  $data['customFieldsEnabled'] = 'false';
1570
  }
1571
-
1572
  /**
1573
  * Exclude some meta from being multilingual.
 
1574
  * @since 2.3.6
1575
  */
1576
  $data['excludeCustomFields'] = array( self::LANGUAGE_META_KEY, 'classic-editor-remember' );
1577
-
1578
  } elseif ( 'nav-menus.php' === $page ) {
1579
 
1580
  $page_action = 'menu-edit';
@@ -1861,7 +1863,7 @@ class WPGlobus {
1861
  */
1862
  if ( version_compare( $GLOBALS['wp_version'], '5.0.999', '>' ) ) {
1863
  $version = '-51';
1864
- }
1865
 
1866
  /**
1867
  * WordPress 5.5+ needs a new version of our admin JS.
@@ -1880,7 +1882,7 @@ class WPGlobus {
1880
  if ( version_compare( $GLOBALS['wp_version'], '5.5.999', '>' ) ) {
1881
  $version = '-56';
1882
  }
1883
-
1884
  /**
1885
  * @since 1.9.17
1886
  */
@@ -1896,25 +1898,25 @@ class WPGlobus {
1896
  wp_enqueue_script( 'wpglobus-admin' );
1897
 
1898
  $current_tab = $config->default_language;
1899
-
1900
  if ( 'post.php' == $page_action ) {
1901
-
1902
  if ( isset( $_GET['post'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
1903
  $_current_tab = get_post_meta( $_GET['post'], self::Config()->builder->get_language_meta_key(), 'true' ); // phpcs:ignore WordPress.CSRF.NonceVerification
1904
  if ( $_current_tab ) {
1905
  $current_tab = $_current_tab;
1906
  }
1907
  }
1908
-
1909
- } else if ( 'taxonomy-edit' == $page_action ) {
1910
 
1911
- $_current_tab = isset($_GET['language']) ? $_GET['language'] : false;
 
 
1912
  if ( $_current_tab ) {
1913
  $current_tab = $_current_tab;
1914
  }
1915
-
1916
  }
1917
-
1918
  } else {
1919
 
1920
  wp_register_script(
@@ -2061,9 +2063,9 @@ class WPGlobus {
2061
  /**
2062
  * @since 2.6.0
2063
  */
2064
- $l10n = array();
2065
- $l10n['imageWidget'] = array();
2066
- $l10n['imageWidget']['suggest'] =
2067
  sprintf( // translators: %s are for A tags.
2068
  esc_html__( 'To have the %1$sImage%2$s widget varying by language,', 'wpglobus' ),
2069
  '<strong>',
@@ -2083,7 +2085,7 @@ class WPGlobus {
2083
  'wp_version' => $GLOBALS['wp_version'], // @since 2.8.0
2084
  'useWidgetsBlockEditor' => WPGlobus::Config()->use_widgets_block_editor // @since 2.8.0
2085
  );
2086
-
2087
  /**
2088
  * Filter for localize data.
2089
  *
@@ -2094,7 +2096,7 @@ class WPGlobus {
2094
  * @return array
2095
  */
2096
  $data = apply_filters( 'wpglobus_widgets_localize_script', $data );
2097
-
2098
  wp_register_script(
2099
  'wpglobus-widgets',
2100
  self::$PLUGIN_DIR_URL . 'includes/js/wpglobus-widgets' . self::$_SCRIPT_SUFFIX . '.js',
@@ -2273,7 +2275,7 @@ class WPGlobus {
2273
  * ); **/
2274
 
2275
  add_submenu_page(
2276
- null,
2277
  '',
2278
  '',
2279
  'administrator',
@@ -2285,7 +2287,7 @@ class WPGlobus {
2285
  );
2286
 
2287
  add_submenu_page(
2288
- null,
2289
  '',
2290
  '',
2291
  'administrator',
@@ -2297,7 +2299,7 @@ class WPGlobus {
2297
  );
2298
 
2299
  add_submenu_page(
2300
- null,
2301
  '',
2302
  '',
2303
  'administrator',
@@ -2346,8 +2348,8 @@ class WPGlobus {
2346
  *
2347
  * @param $sorted_menu_items
2348
  *
2349
- * @internal param $args
2350
  * @return array
 
2351
  */
2352
  public function on_get_convert_url_menu_items( $sorted_menu_items ) {
2353
 
@@ -2490,7 +2492,7 @@ class WPGlobus {
2490
  */
2491
  foreach ( $config->enabled_languages as $language ) {
2492
  $css .= '.wpglobus_flag_' . $language .
2493
- '{background-image:url(' . $config->flags_url . $config->flag[ $language ] . ")}\n";
2494
  }
2495
 
2496
  /**
@@ -2499,7 +2501,7 @@ class WPGlobus {
2499
  */
2500
  if ( is_rtl() ) {
2501
  $css .= '.wpglobus_flag{background-position:center right;}' .
2502
- '.wpglobus_language_name{padding-right:22px;}';
2503
  }
2504
 
2505
  /**
@@ -2599,7 +2601,7 @@ class WPGlobus {
2599
  $span_classes_lang = $this->_get_language_classes( $current_language );
2600
 
2601
  $link_text = '<span class="' . implode( ' ', $span_classes_lang ) . '">' .
2602
- esc_html( $flag_name ) . '</span>';
2603
  $a_tag = '<a class="wpglobus-selector-link" href="' . esc_url( $url ) . '">' . $link_text . '</a>';
2604
 
2605
  /**
@@ -2649,7 +2651,7 @@ class WPGlobus {
2649
  $span_classes_lang = $this->_get_language_classes( $language );
2650
 
2651
  $link_text = '<span class="' . implode( ' ', $span_classes_lang ) . '">' .
2652
- esc_html( $flag_name ) . '</span>';
2653
  $a_tag = '<a class="wpglobus-selector-link" href="' . esc_url( $url ) . '">' . $link_text . '</a>';
2654
 
2655
  $item = new stdClass();
@@ -2699,7 +2701,7 @@ class WPGlobus {
2699
  $span_classes_lang = $this->_get_language_classes( $language );
2700
 
2701
  $link_text = '<span class="' . implode( ' ', $span_classes_lang ) . '">' .
2702
- esc_html( $flag_name ) . '</span>';
2703
  $a_tag = '<a class="wpglobus-selector-link" href="' . esc_url( $url ) . '">' . $link_text . '</a>';
2704
 
2705
  $item = new stdClass();
@@ -2769,11 +2771,11 @@ class WPGlobus {
2769
  *
2770
  * @see wp_list_pages
2771
  *
2772
- * @deprecated from 1.5.8
2773
- *
2774
  * @param string $output The menu HTML string
2775
  *
2776
  * @return string HTML with appended switcher
 
 
2777
  */
2778
  public function on_wp_list_pages( $output ) {
2779
 
@@ -2844,14 +2846,14 @@ class WPGlobus {
2844
  $span_classes_lang = $this->_get_language_classes( $language );
2845
 
2846
  $link_text = '<span class="' . implode( ' ', $span_classes_lang ) . '">' .
2847
- esc_html( $flag_name ) . '</span>';
2848
  $a_tag = '<a class="wpglobus-selector-link" href="' . esc_url( $url ) . '">' . $link_text . '</a>';
2849
 
2850
  if ( $dropdown_menu ) {
2851
 
2852
  $output .= '<li class="page_item page_item_wpglobus_menu_switch page_item_has_children wpglobus-current-language page_item_wpglobus_menu_switch_' . $language . '">' .
2853
- $a_tag .
2854
- '<ul class="children">';
2855
 
2856
  foreach ( $extra_languages as $language ) :
2857
  /**
@@ -2862,22 +2864,22 @@ class WPGlobus {
2862
  $span_classes_lang = $this->_get_language_classes( $language );
2863
 
2864
  $link_text = '<span class="' . implode( ' ', $span_classes_lang ) . '">' .
2865
- esc_html( $flag_name ) . '</span>';
2866
  $a_tag = '<a class="wpglobus-selector-link" href="' . esc_url( $url ) . '">' . $link_text . '</a>';
2867
 
2868
  $output .= '<li class="page_item page_item_wpglobus_menu_switch_' . $language . '">' .
2869
- $a_tag .
2870
- '</li>';
2871
  endforeach;
2872
 
2873
  $output .= '</ul>' .
2874
- '</li>';
2875
 
2876
  } else {
2877
 
2878
  $output .= '<li class="page_item page_item_wpglobus_menu_switch wpglobus-current-language page_item_wpglobus_menu_switch_' . $language . '">' .
2879
- $a_tag .
2880
- '</li>';
2881
 
2882
  foreach ( $extra_languages as $language ) :
2883
  /**
@@ -2889,12 +2891,12 @@ class WPGlobus {
2889
  $span_classes_lang = $this->_get_language_classes( $language );
2890
 
2891
  $link_text = '<span class="' . implode( ' ', $span_classes_lang ) . '">' .
2892
- esc_html( $flag_name ) . '</span>';
2893
  $a_tag = '<a class="wpglobus-selector-link" href="' . esc_url( $url ) . '">' . $link_text . '</a>';
2894
 
2895
  $output .= '<li class="page_item page_item_wpglobus_menu_switch page_item_wpglobus_menu_switch_' . $language . '">' .
2896
- $a_tag .
2897
- '</li>';
2898
  endforeach;
2899
 
2900
  } // $dropdown_menu
@@ -2905,11 +2907,13 @@ class WPGlobus {
2905
  /**
2906
  * Add language switcher to navigation menu
2907
  *
2908
- * @param array $sorted_menu_items
 
2909
  * @param stdClass $args An object containing wp_nav_menu() arguments.
2910
  *
 
 
2911
  * @return array
2912
- * @see wp_nav_menu()
2913
  */
2914
  public function on_add_item(
2915
  $sorted_menu_items, /** @noinspection PhpUnusedParameterInspection */
@@ -2940,10 +2944,10 @@ class WPGlobus {
2940
  }
2941
 
2942
  /* with 2019 theme */
2943
- //error_log(print_r($items, true));
2944
- //unset( $items[1] );
2945
- //error_log(print_r($this->menus, true));
2946
-
2947
  $disable_add_selector = true;
2948
  foreach ( $this->menus as $key => $menu ) {
2949
  $diff = array_diff( $items, $menu->menu_items );
@@ -2988,7 +2992,7 @@ class WPGlobus {
2988
  * @since 1.0.13
2989
  *
2990
  * @param array $extra_languages An array of languages to show in the menu.
2991
- * @param string self::Config()->language The current language.
2992
  */
2993
  $extra_languages = apply_filters( 'wpglobus_extra_languages', $extra_languages, self::Config()->language );
2994
 
@@ -3528,33 +3532,33 @@ class WPGlobus {
3528
  foreach ( self::Config()->open_languages as $language ) {
3529
  $return =
3530
  $language == self::Config()->default_language ? self::RETURN_IN_DEFAULT_LANGUAGE : self::RETURN_EMPTY;
3531
-
3532
- $_href = '';
3533
- $_onclick = '';
3534
- if ( self::Config()->builder->get('taxonomy') && self::Config()->builder->is_builder_page() ) {
3535
- $get = $_GET;
3536
- unset( $get['language'] );
3537
- $get['language'] = $language;
3538
- $_href = admin_url( add_query_arg( $get, 'term.php' ) );
3539
- $_onclick = 'onclick="return false;"';
3540
-
3541
- if ( $language == self::Config()->builder->get_language() ) {
3542
- $_link_class['tab-link-active'] = 'wpglobus-tab-link-active';
3543
- } else {
3544
- $_link_class['tab-link-active'] = '';
3545
- }
3546
  } else {
3547
- $_link_class['tab-link-active'] = $language == self::Config()->default_language ? 'wpglobus-tab-link-active' : '';
3548
  }
 
 
 
3549
  ?>
3550
  <li id="wpglobus-link-tab-<?php echo esc_attr( $language ); ?>" class="wpglobus-tax-edit-tab"
3551
  data-language="<?php echo esc_attr( $language ); ?>"
3552
  data-name="<?php echo esc_attr( WPGlobus_Core::text_filter( $object->name, $language, $return ) ); ?>"
3553
  data-description="<?php echo esc_attr( WPGlobus_Core::text_filter( $object->description, $language, $return ) ); ?>">
3554
- <a data-language="<?php echo esc_attr( $language ); ?>"
3555
- data-href="<?php echo $_href; ?>" <?php echo $_onclick; ?>
3556
- class="<?php echo implode( $_link_class ); ?>"
3557
- href="#taxonomy-tab-<?php echo esc_attr( $language ); ?>"><?php echo esc_html( self::Config()->en_language_name[ $language ] ); ?></a>
3558
  </li>
3559
  <?php
3560
  }
@@ -3624,13 +3628,13 @@ class WPGlobus {
3624
  } else {
3625
  $_link_class = $link_class;
3626
  }
3627
-
3628
  /**
3629
  * @since 2.4.5
3630
  */
3631
  if ( self::Config()->default_language === $language ) {
3632
  $_link_class['tab-link-active'] = 'wpglobus-tab-link-active';
3633
- }
3634
  ?>
3635
  <li id="link-tab-<?php echo esc_attr( $tab_suffix ); ?>"
3636
  data-language="<?php echo esc_attr( $language ); ?>"
@@ -3687,7 +3691,7 @@ class WPGlobus {
3687
  * @since 2.6.2
3688
  *
3689
  * @param bool true If show title fields.
3690
- * @param $post An object WP_Post.
3691
  *
3692
  * Returning boolean.
3693
  */
@@ -3798,18 +3802,19 @@ class WPGlobus {
3798
  /**
3799
  * Filter the array of disabled entities returned for load tabs, scripts, styles.
3800
  *
3801
- * @since 1.7.6
3802
- *
3803
  * @see 'wpglobus_disabled_entities' filter in 'admin_init' action.
3804
  *
 
 
3805
  * @param array $disabled_entities Array of disabled entities.
3806
  *
3807
  * @return boolean
3808
  */
3809
  $this->disabled_entities = apply_filters( 'wpglobus_disabled_entities', $this->disabled_entities );
3810
-
3811
  /**
3812
  * Synchronize with Config.
 
3813
  * @since 2.1.8
3814
  */
3815
  self::Config()->disabled_entities = $this->disabled_entities;
@@ -3825,11 +3830,11 @@ class WPGlobus {
3825
  /**
3826
  * Get raw term names for $taxonomy
3827
  *
3828
- * @todo This method should be somewhere else
3829
- *
3830
  * @param string $taxonomy
3831
  *
3832
  * @return array|WP_Error
 
 
3833
  */
3834
  public static function _get_terms( $taxonomy = '' ) {
3835
 
@@ -3913,9 +3918,9 @@ class WPGlobus {
3913
 
3914
  ?>
3915
  <script type='text/javascript'>
3916
- /* <![CDATA[ */
3917
- jQuery('#wp-admin-bar-site-name a').eq(0).text("<?php echo esc_js( $bn ); ?>");
3918
- /* ]]> */
3919
  </script>
3920
  <?php
3921
  /**
@@ -4100,17 +4105,19 @@ class WPGlobus {
4100
  *
4101
  * @since 1.0.0
4102
  *
 
 
4103
  * @todo may be remove this filter @see 'wpglobus_disabled_entities' in disabled_entity().
4104
  *
4105
- * @param array $disabled_entities Array of disabled entities.
4106
  */
4107
  $this->disabled_entities = apply_filters( 'wpglobus_disabled_entities', $this->disabled_entities );
4108
-
4109
  /**
4110
  * Synchronize with Config.
 
4111
  * @since 2.1.8
4112
  */
4113
- self::Config()->disabled_entities = $this->disabled_entities;
4114
 
4115
  /**
4116
  * Filter the array of opened languages.
@@ -4136,9 +4143,10 @@ class WPGlobus {
4136
  /**
4137
  * Add class to body in admin
4138
  *
4139
- * @since 1.0.10
4140
  * @see admin_body_class filter
4141
  *
 
 
4142
  * @param string $classes
4143
  *
4144
  * @return string
@@ -4157,7 +4165,7 @@ class WPGlobus {
4157
  */
4158
  public function on_admin_bar_menu( WP_Admin_Bar $wp_admin_bar ) {
4159
  require_once dirname( __FILE__ ) . '/admin/class-wpglobus-admin-bar-menu.php';
4160
- WPGlobus_Admin_Bar_Menu::construct($wp_admin_bar);
4161
  }
4162
 
4163
  /**
66
  /**
67
  * WPGlobus HelpDesk page
68
  *
 
69
  * @since 1.6.5
70
+ * @var string
71
  */
72
  const PAGE_WPGLOBUS_HELPDESK = 'wpglobus-helpdesk';
73
 
74
  /**
75
  * WPGlobus Admin Central page
76
  *
 
77
  * @since 1.6.6
78
+ * @var string
79
  */
80
  const PAGE_WPGLOBUS_ADMIN_CENTRAL = 'wpglobus-admin-central';
81
+
82
  /**
83
  * WordPress User edit page name.
84
  *
85
  * @since 2.5.3
86
+ */
87
  const WP_USER_EDIT_PAGE = 'user-edit.php';
88
 
89
  /**
146
  /**
147
  * Path to languages folder.
148
  *
 
149
  * @since 1.9.6
150
+ * @return string
151
  */
152
  public static function languages_path() {
153
  return self::$PLUGIN_DIR_PATH . 'languages';
156
  /**
157
  * Get language meta key.
158
  *
 
159
  * @since 1.9.17
160
+ * @return string
161
  */
162
  public static function get_language_meta_key() {
163
  return self::LANGUAGE_META_KEY;
244
  if ( function_exists( 'acf' ) ) {
245
 
246
  /**
 
 
247
  * @see 'wpglobus_disabled_entities' filter for add/remove custom post types to array disabled_entities
248
  * @since 1.0.4
249
+ * @todo Work on the ACF compatibility is in progress
250
+ * Temporarily add CPT acf ( Advanced Custom Fields ) to the array of disabled_entities
251
  */
252
  global $acf;
253
  if ( ! empty( $acf->settings['pro'] ) && $acf->settings['pro'] ) {
263
  if ( defined( 'WC_VERSION' ) || defined( 'WOOCOMMERCE_VERSION' ) ) {
264
 
265
  $this->vendors_scripts['WOOCOMMERCE'] = true;
266
+
267
  /**
268
  * @todo May be move to includes\class-wpglobus-post-types.php
269
+ */
270
  $this->disabled_entities[] = 'product_tag';
271
  $this->disabled_entities[] = 'product_cat';
272
 
330
  * @since 2.2.35
331
  */
332
  require_once dirname( __FILE__ ) . '/builders/class-wpglobus-builder-update-post.php';
333
+
334
  require_once dirname( __FILE__ ) . '/builders/gutenberg/class-wpglobus-gutenberg-update-post.php';
335
  new WPGlobus_Gutenberg_Update_Post();
336
 
346
  * @since 2.2.35
347
  */
348
  require_once dirname( __FILE__ ) . '/builders/class-wpglobus-builder-update-post.php';
349
+
350
  /** @noinspection PhpIncludeInspection */
351
  require_once $_file;
352
  $class_update_post = "WPGlobus_${id}_Update_Post";
358
  */
359
  if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
360
  $_short_file = 'builders/' . $id . '/class-wpglobus-' . $id . '-update-post.php';
361
+ error_log( print_r( '[' . basename( __FILE__ ) . ']:: File `' . $_short_file . '` was expected in `' . __CLASS__ . '` class.', true ) );
362
+ }
363
  }
364
  }
365
  }
416
  new WPGlobus_Options();
417
 
418
  /**
 
419
  * @see 'post_submitbox_misc_actions'
420
+ * @since 1.9.17
421
  */
422
  add_action( 'post_submitbox_misc_actions', array(
423
  $this,
425
  ) );
426
 
427
  /**
 
428
  * @see 'post_submitbox_misc_actions'
429
+ * @since 2.4.12
430
  */
431
  add_action( 'post_submitbox_misc_actions', array(
432
  $this,
454
  );
455
  }
456
  }
457
+
458
  /**
459
  * @since 1.9.17
460
  */
466
  * Let's load all needed vendors.
467
  */
468
  require_once dirname( __FILE__ ) . '/vendor/wpglobus-vendors.php';
469
+
470
  /**
471
  * @since 2.2.22
472
  */
520
  'on__admin_title',
521
  ), 10, 2 );
522
 
523
+ /**
524
  * Moved from below.
525
+ *
526
  * @since 2.7.9
527
  */
528
  add_action( 'admin_bar_menu', array(
563
  */
564
  if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
565
  $_short_file = 'builders/' . self::Config()->builder->get_id() . '/class-wpglobus-' . self::Config()->builder->get_id() . '.php';
566
+ error_log( print_r( '[' . basename( __FILE__ ) . ']:: File `' . $_short_file . '` was expected in `' . __CLASS__ . '` class.', true ) );
567
+ }
568
  }
569
  }
570
  }
621
  'edit.php',
622
  ) )
623
  ) {
624
+
625
  if ( self::Config()->builder->is_builder_page() ) {
626
  /** Don't run in Builder mode. */
627
+ } else {
628
  /**
629
  * Support Standard/Classic mode.
630
  */
631
+
632
  /** @global WP_Post $post */
633
  global $post;
634
 
638
  }
639
  }
640
  }
641
+
642
  /**
643
  * @since 2.6.6
644
  */
652
  )
653
  ) {
654
  require_once( 'vendor/acf/class-wpglobus-vendor-acf.php' );
655
+ WPGlobus_Vendor_Acf::get_instance(
656
  array(
657
+ 'vendor_scripts' => $this->vendors_scripts,
658
  )
659
+ );
660
  require_once 'vendor/class-wpglobus-acf.php';
661
  $WPGlobus_acf = new WPGlobus_Acf();
662
  }
663
+
664
  /**
665
+ * @since 2.2.22
666
  */
667
  require_once 'admin/media/wpglobus-media.php';
668
 
675
 
676
  // @since 2.7.9 moved above
677
  //add_action( 'admin_bar_menu', array(
678
+ //$this,
679
+ //'on_admin_bar_menu',
680
  //) );
681
 
682
  /**
1115
  /**
1116
  * Set transient wpglobus_activated after activated plugin @see on_admin_init()
1117
  *
 
 
1118
  * @param string $plugin
1119
  *
1120
  * @return void
1121
+ * @todo use $WPGlobus_Config to determine running this function?
1122
+ *
1123
  */
1124
  public static function activated( $plugin ) {
1125
  if ( WPGLOBUS_PLUGIN_BASENAME == $plugin ) {
1214
  *
1215
  * @since 2.4.12
1216
  *
1217
+ * @return void
1218
  */
1219
  public function on__add_actions() {
1220
 
1231
  if ( $this->disabled_entity( $post->post_type ) ) {
1232
  return;
1233
  }
1234
+
1235
  /**
1236
  * Add switcher to the publish metabox.
1237
  *
1241
  */
1242
  do_action( 'wpglobus_submitbox_action', $post );
1243
  }
1244
+
1245
  /**
1246
  * Add switcher to publish metabox.
1247
  *
1569
  } else {
1570
  $data['customFieldsEnabled'] = 'false';
1571
  }
1572
+
1573
  /**
1574
  * Exclude some meta from being multilingual.
1575
+ *
1576
  * @since 2.3.6
1577
  */
1578
  $data['excludeCustomFields'] = array( self::LANGUAGE_META_KEY, 'classic-editor-remember' );
1579
+
1580
  } elseif ( 'nav-menus.php' === $page ) {
1581
 
1582
  $page_action = 'menu-edit';
1863
  */
1864
  if ( version_compare( $GLOBALS['wp_version'], '5.0.999', '>' ) ) {
1865
  $version = '-51';
1866
+ }
1867
 
1868
  /**
1869
  * WordPress 5.5+ needs a new version of our admin JS.
1882
  if ( version_compare( $GLOBALS['wp_version'], '5.5.999', '>' ) ) {
1883
  $version = '-56';
1884
  }
1885
+
1886
  /**
1887
  * @since 1.9.17
1888
  */
1898
  wp_enqueue_script( 'wpglobus-admin' );
1899
 
1900
  $current_tab = $config->default_language;
1901
+
1902
  if ( 'post.php' == $page_action ) {
1903
+
1904
  if ( isset( $_GET['post'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
1905
  $_current_tab = get_post_meta( $_GET['post'], self::Config()->builder->get_language_meta_key(), 'true' ); // phpcs:ignore WordPress.CSRF.NonceVerification
1906
  if ( $_current_tab ) {
1907
  $current_tab = $_current_tab;
1908
  }
1909
  }
 
 
1910
 
1911
+ } elseif ( 'taxonomy-edit' == $page_action ) {
1912
+
1913
+ $_current_tab = isset( $_GET['language'] ) ? $_GET['language'] : false;
1914
  if ( $_current_tab ) {
1915
  $current_tab = $_current_tab;
1916
  }
1917
+
1918
  }
1919
+
1920
  } else {
1921
 
1922
  wp_register_script(
2063
  /**
2064
  * @since 2.6.0
2065
  */
2066
+ $l10n = array();
2067
+ $l10n['imageWidget'] = array();
2068
+ $l10n['imageWidget']['suggest'] =
2069
  sprintf( // translators: %s are for A tags.
2070
  esc_html__( 'To have the %1$sImage%2$s widget varying by language,', 'wpglobus' ),
2071
  '<strong>',
2085
  'wp_version' => $GLOBALS['wp_version'], // @since 2.8.0
2086
  'useWidgetsBlockEditor' => WPGlobus::Config()->use_widgets_block_editor // @since 2.8.0
2087
  );
2088
+
2089
  /**
2090
  * Filter for localize data.
2091
  *
2096
  * @return array
2097
  */
2098
  $data = apply_filters( 'wpglobus_widgets_localize_script', $data );
2099
+
2100
  wp_register_script(
2101
  'wpglobus-widgets',
2102
  self::$PLUGIN_DIR_URL . 'includes/js/wpglobus-widgets' . self::$_SCRIPT_SUFFIX . '.js',
2275
  * ); **/
2276
 
2277
  add_submenu_page(
2278
+ '',
2279
  '',
2280
  '',
2281
  'administrator',
2287
  );
2288
 
2289
  add_submenu_page(
2290
+ '',
2291
  '',
2292
  '',
2293
  'administrator',
2299
  );
2300
 
2301
  add_submenu_page(
2302
+ '',
2303
  '',
2304
  '',
2305
  'administrator',
2348
  *
2349
  * @param $sorted_menu_items
2350
  *
 
2351
  * @return array
2352
+ * @internal param $args
2353
  */
2354
  public function on_get_convert_url_menu_items( $sorted_menu_items ) {
2355
 
2492
  */
2493
  foreach ( $config->enabled_languages as $language ) {
2494
  $css .= '.wpglobus_flag_' . $language .
2495
+ '{background-image:url(' . $config->flags_url . $config->flag[ $language ] . ")}\n";
2496
  }
2497
 
2498
  /**
2501
  */
2502
  if ( is_rtl() ) {
2503
  $css .= '.wpglobus_flag{background-position:center right;}' .
2504
+ '.wpglobus_language_name{padding-right:22px;}';
2505
  }
2506
 
2507
  /**
2601
  $span_classes_lang = $this->_get_language_classes( $current_language );
2602
 
2603
  $link_text = '<span class="' . implode( ' ', $span_classes_lang ) . '">' .
2604
+ esc_html( $flag_name ) . '</span>';
2605
  $a_tag = '<a class="wpglobus-selector-link" href="' . esc_url( $url ) . '">' . $link_text . '</a>';
2606
 
2607
  /**
2651
  $span_classes_lang = $this->_get_language_classes( $language );
2652
 
2653
  $link_text = '<span class="' . implode( ' ', $span_classes_lang ) . '">' .
2654
+ esc_html( $flag_name ) . '</span>';
2655
  $a_tag = '<a class="wpglobus-selector-link" href="' . esc_url( $url ) . '">' . $link_text . '</a>';
2656
 
2657
  $item = new stdClass();
2701
  $span_classes_lang = $this->_get_language_classes( $language );
2702
 
2703
  $link_text = '<span class="' . implode( ' ', $span_classes_lang ) . '">' .
2704
+ esc_html( $flag_name ) . '</span>';
2705
  $a_tag = '<a class="wpglobus-selector-link" href="' . esc_url( $url ) . '">' . $link_text . '</a>';
2706
 
2707
  $item = new stdClass();
2771
  *
2772
  * @see wp_list_pages
2773
  *
 
 
2774
  * @param string $output The menu HTML string
2775
  *
2776
  * @return string HTML with appended switcher
2777
+ * @deprecated from 1.5.8
2778
+ *
2779
  */
2780
  public function on_wp_list_pages( $output ) {
2781
 
2846
  $span_classes_lang = $this->_get_language_classes( $language );
2847
 
2848
  $link_text = '<span class="' . implode( ' ', $span_classes_lang ) . '">' .
2849
+ esc_html( $flag_name ) . '</span>';
2850
  $a_tag = '<a class="wpglobus-selector-link" href="' . esc_url( $url ) . '">' . $link_text . '</a>';
2851
 
2852
  if ( $dropdown_menu ) {
2853
 
2854
  $output .= '<li class="page_item page_item_wpglobus_menu_switch page_item_has_children wpglobus-current-language page_item_wpglobus_menu_switch_' . $language . '">' .
2855
+ $a_tag .
2856
+ '<ul class="children">';
2857
 
2858
  foreach ( $extra_languages as $language ) :
2859
  /**
2864
  $span_classes_lang = $this->_get_language_classes( $language );
2865
 
2866
  $link_text = '<span class="' . implode( ' ', $span_classes_lang ) . '">' .
2867
+ esc_html( $flag_name ) . '</span>';
2868
  $a_tag = '<a class="wpglobus-selector-link" href="' . esc_url( $url ) . '">' . $link_text . '</a>';
2869
 
2870
  $output .= '<li class="page_item page_item_wpglobus_menu_switch_' . $language . '">' .
2871
+ $a_tag .
2872
+ '</li>';
2873
  endforeach;
2874
 
2875
  $output .= '</ul>' .
2876
+ '</li>';
2877
 
2878
  } else {
2879
 
2880
  $output .= '<li class="page_item page_item_wpglobus_menu_switch wpglobus-current-language page_item_wpglobus_menu_switch_' . $language . '">' .
2881
+ $a_tag .
2882
+ '</li>';
2883
 
2884
  foreach ( $extra_languages as $language ) :
2885
  /**
2891
  $span_classes_lang = $this->_get_language_classes( $language );
2892
 
2893
  $link_text = '<span class="' . implode( ' ', $span_classes_lang ) . '">' .
2894
+ esc_html( $flag_name ) . '</span>';
2895
  $a_tag = '<a class="wpglobus-selector-link" href="' . esc_url( $url ) . '">' . $link_text . '</a>';
2896
 
2897
  $output .= '<li class="page_item page_item_wpglobus_menu_switch page_item_wpglobus_menu_switch_' . $language . '">' .
2898
+ $a_tag .
2899
+ '</li>';
2900
  endforeach;
2901
 
2902
  } // $dropdown_menu
2907
  /**
2908
  * Add language switcher to navigation menu
2909
  *
2910
+ * @see wp_nav_menu()
2911
+ *
2912
  * @param stdClass $args An object containing wp_nav_menu() arguments.
2913
  *
2914
+ * @param array $sorted_menu_items
2915
+ *
2916
  * @return array
 
2917
  */
2918
  public function on_add_item(
2919
  $sorted_menu_items, /** @noinspection PhpUnusedParameterInspection */
2944
  }
2945
 
2946
  /* with 2019 theme */
2947
+ //error_log(print_r($items, true));
2948
+ //unset( $items[1] );
2949
+ //error_log(print_r($this->menus, true));
2950
+
2951
  $disable_add_selector = true;
2952
  foreach ( $this->menus as $key => $menu ) {
2953
  $diff = array_diff( $items, $menu->menu_items );
2992
  * @since 1.0.13
2993
  *
2994
  * @param array $extra_languages An array of languages to show in the menu.
2995
+ * @param string self::Config()->language The current language.
2996
  */
2997
  $extra_languages = apply_filters( 'wpglobus_extra_languages', $extra_languages, self::Config()->language );
2998
 
3532
  foreach ( self::Config()->open_languages as $language ) {
3533
  $return =
3534
  $language == self::Config()->default_language ? self::RETURN_IN_DEFAULT_LANGUAGE : self::RETURN_EMPTY;
3535
+
3536
+ $_href = '';
3537
+ $_onclick = '';
3538
+ if ( self::Config()->builder->get( 'taxonomy' ) && self::Config()->builder->is_builder_page() ) {
3539
+ $get = $_GET;
3540
+ unset( $get['language'] );
3541
+ $get['language'] = $language;
3542
+ $_href = admin_url( add_query_arg( $get, 'term.php' ) );
3543
+ $_onclick = 'onclick="return false;"';
3544
+
3545
+ if ( $language == self::Config()->builder->get_language() ) {
3546
+ $_link_class['tab-link-active'] = 'wpglobus-tab-link-active';
 
 
 
3547
  } else {
3548
+ $_link_class['tab-link-active'] = '';
3549
  }
3550
+ } else {
3551
+ $_link_class['tab-link-active'] = $language == self::Config()->default_language ? 'wpglobus-tab-link-active' : '';
3552
+ }
3553
  ?>
3554
  <li id="wpglobus-link-tab-<?php echo esc_attr( $language ); ?>" class="wpglobus-tax-edit-tab"
3555
  data-language="<?php echo esc_attr( $language ); ?>"
3556
  data-name="<?php echo esc_attr( WPGlobus_Core::text_filter( $object->name, $language, $return ) ); ?>"
3557
  data-description="<?php echo esc_attr( WPGlobus_Core::text_filter( $object->description, $language, $return ) ); ?>">
3558
+ <a data-language="<?php echo esc_attr( $language ); ?>"
3559
+ data-href="<?php echo $_href; ?>" <?php echo $_onclick; ?>
3560
+ class="<?php echo implode( $_link_class ); ?>"
3561
+ href="#taxonomy-tab-<?php echo esc_attr( $language ); ?>"><?php echo esc_html( self::Config()->en_language_name[ $language ] ); ?></a>
3562
  </li>
3563
  <?php
3564
  }
3628
  } else {
3629
  $_link_class = $link_class;
3630
  }
3631
+
3632
  /**
3633
  * @since 2.4.5
3634
  */
3635
  if ( self::Config()->default_language === $language ) {
3636
  $_link_class['tab-link-active'] = 'wpglobus-tab-link-active';
3637
+ }
3638
  ?>
3639
  <li id="link-tab-<?php echo esc_attr( $tab_suffix ); ?>"
3640
  data-language="<?php echo esc_attr( $language ); ?>"
3691
  * @since 2.6.2
3692
  *
3693
  * @param bool true If show title fields.
3694
+ * @param $post An object WP_Post.
3695
  *
3696
  * Returning boolean.
3697
  */
3802
  /**
3803
  * Filter the array of disabled entities returned for load tabs, scripts, styles.
3804
  *
 
 
3805
  * @see 'wpglobus_disabled_entities' filter in 'admin_init' action.
3806
  *
3807
+ * @since 1.7.6
3808
+ *
3809
  * @param array $disabled_entities Array of disabled entities.
3810
  *
3811
  * @return boolean
3812
  */
3813
  $this->disabled_entities = apply_filters( 'wpglobus_disabled_entities', $this->disabled_entities );
3814
+
3815
  /**
3816
  * Synchronize with Config.
3817
+ *
3818
  * @since 2.1.8
3819
  */
3820
  self::Config()->disabled_entities = $this->disabled_entities;
3830
  /**
3831
  * Get raw term names for $taxonomy
3832
  *
 
 
3833
  * @param string $taxonomy
3834
  *
3835
  * @return array|WP_Error
3836
+ * @todo This method should be somewhere else
3837
+ *
3838
  */
3839
  public static function _get_terms( $taxonomy = '' ) {
3840
 
3918
 
3919
  ?>
3920
  <script type='text/javascript'>
3921
+ /* <![CDATA[ */
3922
+ jQuery('#wp-admin-bar-site-name a').eq(0).text("<?php echo esc_js( $bn ); ?>");
3923
+ /* ]]> */
3924
  </script>
3925
  <?php
3926
  /**
4105
  *
4106
  * @since 1.0.0
4107
  *
4108
+ * @param array $disabled_entities Array of disabled entities.
4109
+ *
4110
  * @todo may be remove this filter @see 'wpglobus_disabled_entities' in disabled_entity().
4111
  *
 
4112
  */
4113
  $this->disabled_entities = apply_filters( 'wpglobus_disabled_entities', $this->disabled_entities );
4114
+
4115
  /**
4116
  * Synchronize with Config.
4117
+ *
4118
  * @since 2.1.8
4119
  */
4120
+ self::Config()->disabled_entities = $this->disabled_entities;
4121
 
4122
  /**
4123
  * Filter the array of opened languages.
4143
  /**
4144
  * Add class to body in admin
4145
  *
 
4146
  * @see admin_body_class filter
4147
  *
4148
+ * @since 1.0.10
4149
+ *
4150
  * @param string $classes
4151
  *
4152
  * @return string
4165
  */
4166
  public function on_admin_bar_menu( WP_Admin_Bar $wp_admin_bar ) {
4167
  require_once dirname( __FILE__ ) . '/admin/class-wpglobus-admin-bar-menu.php';
4168
+ WPGlobus_Admin_Bar_Menu::construct( $wp_admin_bar );
4169
  }
4170
 
4171
  /**
includes/vendor/yoast-seo/class-wpglobus-yoastseo140.php CHANGED
@@ -506,6 +506,35 @@ class WPGlobus_YoastSEO {
506
  if ( WPGlobus_Core::has_translations($description) ) {
507
  $description = WPGlobus_Core::text_filter( $description, WPGlobus::Config()->language );
508
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
  }
510
 
511
  return $description;
@@ -740,7 +769,35 @@ class WPGlobus_YoastSEO {
740
  $__title = self::get_option( 'wpseo_titles', 'title-tax-' . $presentation->model->object_sub_type );
741
  }
742
 
743
- $title = wpseo_replace_vars( $__title, $presentation->source );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
744
  }
745
 
746
  return $title;
@@ -928,7 +985,7 @@ class WPGlobus_YoastSEO {
928
  $description = wpseo_replace_vars( $description, $presentation->source );
929
  }
930
 
931
- } else if ( 'term' == $presentation->model->object_type ) {
932
 
933
  /**
934
  * Taxonomy.
@@ -968,7 +1025,7 @@ class WPGlobus_YoastSEO {
968
  }
969
  }
970
 
971
- } else if ( 'home-page' == $presentation->model->object_type ) {
972
 
973
  /**
974
  * When homepage displays latest post.
@@ -986,6 +1043,37 @@ class WPGlobus_YoastSEO {
986
  }
987
 
988
  $description = wpseo_replace_vars( $description, $presentation->source );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
989
  }
990
 
991
  /**
@@ -1766,6 +1854,7 @@ class WPGlobus_YoastSEO {
1766
  * @since 2.5.1 Added support of taxonomies.
1767
  * @since 2.7.11 Added filter for breadcrumb title.
1768
  * @since 2.8.9 Added filter for taxonomy term name.
 
1769
  *
1770
  * @scope front
1771
  * @param array $graph_piece Array of graph piece.
@@ -1787,7 +1876,7 @@ class WPGlobus_YoastSEO {
1787
  $graph_piece['description'] = WPGlobus_Core::extract_text( $graph_piece['description'], WPGlobus::Config()->language );
1788
  }
1789
 
1790
- } else if ( 'term' == $context->indexable->object_type ) {
1791
 
1792
  /**
1793
  * Taxonomy.
@@ -1814,7 +1903,7 @@ class WPGlobus_YoastSEO {
1814
  $graph_piece['name'] = WPGlobus_Core::extract_text( $graph_piece['name'], WPGlobus::Config()->language );
1815
  }
1816
 
1817
- } else if ( 'home-page' == $context->indexable->object_type ) {
1818
 
1819
  /**
1820
  * When homepage displays latest post.
@@ -1822,7 +1911,21 @@ class WPGlobus_YoastSEO {
1822
  */
1823
  if ( ! empty( $graph_piece['description'] ) && WPGlobus_Core::has_translations( $graph_piece['description'] ) ) {
1824
  $graph_piece['description'] = WPGlobus_Core::extract_text( $graph_piece['description'], WPGlobus::Config()->language );
 
 
 
 
 
 
 
 
 
 
 
 
 
1825
  }
 
1826
  }
1827
 
1828
  return $graph_piece;
@@ -1891,6 +1994,34 @@ class WPGlobus_YoastSEO {
1891
 
1892
  $title = wpseo_replace_vars( $__title, $presentation->source );
1893
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1894
  }
1895
 
1896
  return $title;
506
  if ( WPGlobus_Core::has_translations($description) ) {
507
  $description = WPGlobus_Core::text_filter( $description, WPGlobus::Config()->language );
508
  }
509
+
510
+ } elseif ( 'user' == $presentation->model->object_type ) {
511
+
512
+ /**
513
+ * @since 2.10.1
514
+ */
515
+ $meta_cache = wp_cache_get( $presentation->model->object_id, 'user_meta' );
516
+
517
+ if ( ! empty( $meta_cache['wpseo_metadesc'][0] ) ) {
518
+
519
+ $description = WPGlobus_Core::text_filter( $meta_cache['wpseo_metadesc'][0], WPGlobus::Config()->language );
520
+ $description = wpseo_replace_vars( $description, $presentation->source );
521
+
522
+ } else {
523
+
524
+ if ( empty($description) ) {
525
+ $description = self::get_option( 'wpseo_titles', 'metadesc-author-wpseo' );
526
+ }
527
+
528
+ if ( ! empty($description) ) {
529
+
530
+ if ( WPGlobus_Core::has_translations($description) ) {
531
+ $description = WPGlobus_Core::text_filter( $description, WPGlobus::Config()->language );
532
+ }
533
+
534
+ $description = wpseo_replace_vars( $description, $presentation->source );
535
+ }
536
+
537
+ }
538
  }
539
 
540
  return $description;
769
  $__title = self::get_option( 'wpseo_titles', 'title-tax-' . $presentation->model->object_sub_type );
770
  }
771
 
772
+ $title = wpseo_replace_vars( $__title, $presentation->source );
773
+
774
+ } elseif ( 'user' == $presentation->model->object_type ) {
775
+
776
+ /**
777
+ * @since 2.10.1
778
+ */
779
+ $meta_cache = wp_cache_get( $presentation->model->object_id, 'user_meta' );
780
+
781
+ if ( ! empty( $meta_cache['wpseo_title'][0] ) ) {
782
+
783
+ $title = WPGlobus_Core::text_filter( $meta_cache['wpseo_title'][0], WPGlobus::Config()->language );
784
+ $title = wpseo_replace_vars( $title, $presentation->source );
785
+
786
+ } else {
787
+
788
+ if ( empty($title) ) {
789
+ $title = self::get_option( 'wpseo_titles', 'title-author-wpseo' );
790
+ }
791
+
792
+ if ( ! empty($title) ) {
793
+
794
+ if ( WPGlobus_Core::has_translations($title) ) {
795
+ $title = WPGlobus_Core::text_filter( $title, WPGlobus::Config()->language );
796
+ }
797
+
798
+ $title = wpseo_replace_vars( $title, $presentation->source );
799
+ }
800
+ }
801
  }
802
 
803
  return $title;
985
  $description = wpseo_replace_vars( $description, $presentation->source );
986
  }
987
 
988
+ } elseif ( 'term' == $presentation->model->object_type ) {
989
 
990
  /**
991
  * Taxonomy.
1025
  }
1026
  }
1027
 
1028
+ } elseif ( 'home-page' == $presentation->model->object_type ) {
1029
 
1030
  /**
1031
  * When homepage displays latest post.
1043
  }
1044
 
1045
  $description = wpseo_replace_vars( $description, $presentation->source );
1046
+
1047
+ } elseif ( 'user' == $presentation->model->object_type ) {
1048
+
1049
+ /**
1050
+ * @since 2.10.1
1051
+ */
1052
+ $meta_cache = wp_cache_get( $presentation->model->object_id, 'user_meta' );
1053
+
1054
+ if ( ! empty( $meta_cache['wpseo_metadesc'][0] ) ) {
1055
+
1056
+ $description = WPGlobus_Core::text_filter( $meta_cache['wpseo_metadesc'][0], WPGlobus::Config()->language );
1057
+ $description = wpseo_replace_vars( $description, $presentation->source );
1058
+
1059
+ } else {
1060
+
1061
+ if ( empty($description) ) {
1062
+ $description = self::get_option( 'wpseo_titles', 'metadesc-author-wpseo' );
1063
+ }
1064
+
1065
+ if ( empty($description) ) {
1066
+ $meta_description_presenter_was_fired = true;
1067
+ } else {
1068
+
1069
+ if ( WPGlobus_Core::has_translations($description) ) {
1070
+ $description = WPGlobus_Core::text_filter( $description, WPGlobus::Config()->language );
1071
+ }
1072
+ $description = wpseo_replace_vars( $description, $presentation->source );
1073
+
1074
+ }
1075
+
1076
+ }
1077
  }
1078
 
1079
  /**
1854
  * @since 2.5.1 Added support of taxonomies.
1855
  * @since 2.7.11 Added filter for breadcrumb title.
1856
  * @since 2.8.9 Added filter for taxonomy term name.
1857
+ * @since 2.10.1 Added filter for user object type.
1858
  *
1859
  * @scope front
1860
  * @param array $graph_piece Array of graph piece.
1876
  $graph_piece['description'] = WPGlobus_Core::extract_text( $graph_piece['description'], WPGlobus::Config()->language );
1877
  }
1878
 
1879
+ } elseif ( 'term' == $context->indexable->object_type ) {
1880
 
1881
  /**
1882
  * Taxonomy.
1903
  $graph_piece['name'] = WPGlobus_Core::extract_text( $graph_piece['name'], WPGlobus::Config()->language );
1904
  }
1905
 
1906
+ } elseif ( 'home-page' == $context->indexable->object_type ) {
1907
 
1908
  /**
1909
  * When homepage displays latest post.
1911
  */
1912
  if ( ! empty( $graph_piece['description'] ) && WPGlobus_Core::has_translations( $graph_piece['description'] ) ) {
1913
  $graph_piece['description'] = WPGlobus_Core::extract_text( $graph_piece['description'], WPGlobus::Config()->language );
1914
+ }
1915
+
1916
+ } elseif ( 'user' == $context->indexable->object_type ) {
1917
+
1918
+ /**
1919
+ * @since 2.10.1
1920
+ */
1921
+ if ( ! empty( $graph_piece['description'] ) && WPGlobus_Core::has_translations( $graph_piece['description'] ) ) {
1922
+ $graph_piece['description'] = WPGlobus_Core::extract_text( $graph_piece['description'], WPGlobus::Config()->language );
1923
+ }
1924
+
1925
+ if ( ! empty( $graph_piece['name'] ) && WPGlobus_Core::has_translations( $graph_piece['name'] ) ) {
1926
+ $graph_piece['name'] = WPGlobus_Core::extract_text( $graph_piece['name'], WPGlobus::Config()->language );
1927
  }
1928
+
1929
  }
1930
 
1931
  return $graph_piece;
1994
 
1995
  $title = wpseo_replace_vars( $__title, $presentation->source );
1996
 
1997
+ } elseif ( 'user' == $presentation->model->object_type ) {
1998
+
1999
+ /**
2000
+ * @since 2.10.1
2001
+ */
2002
+ $meta_cache = wp_cache_get( $presentation->model->object_id, 'user_meta' );
2003
+
2004
+ if ( ! empty( $meta_cache['wpseo_title'][0] ) ) {
2005
+
2006
+ $title = WPGlobus_Core::text_filter( $meta_cache['wpseo_title'][0], WPGlobus::Config()->language );
2007
+ $title = wpseo_replace_vars( $title, $presentation->source );
2008
+
2009
+ } else {
2010
+
2011
+ if ( empty($title) ) {
2012
+ $title = self::get_option( 'wpseo_titles', 'title-author-wpseo' );
2013
+ }
2014
+
2015
+ if ( ! empty($title) ) {
2016
+
2017
+ if ( WPGlobus_Core::has_translations($title) ) {
2018
+ $title = WPGlobus_Core::text_filter( $title, WPGlobus::Config()->language );
2019
+ }
2020
+
2021
+ $title = wpseo_replace_vars( $title, $presentation->source );
2022
+ }
2023
+ }
2024
+
2025
  }
2026
 
2027
  return $title;
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.5
6
- Tested up to: 5.8
7
  Requires PHP: 5.6
8
  Stable tag: trunk
9
  License: GPL-3.0-or-later
@@ -113,8 +113,6 @@ Some 3rd-party plugins are supported with our [premium add-ons](https://wpglobus
113
  * [WooCommerce and some of its extensions](https://wpglobus.com/product/woocommerce-wpglobus/),
114
  * [WooCommerce Nets Netaxept Payment Plugin](https://wpglobus.com/product/multilingual-woocommerce-nets-netaxept/)
115
 
116
- WPGlobus is compatible with ClassicPress Version 1.
117
-
118
  = Permalinks =
119
 
120
  **IMPORTANT:** WPGlobus will not work if your URLs look like `example.com?p=123` or `example.com/index.php/category/post/`.
@@ -220,34 +218,14 @@ WPGlobus Version 2 supports WordPress 5.x, with Gutenberg.
220
 
221
  == Changelog ==
222
 
 
 
 
 
223
  = 2.10.0 =
224
  * (Compatibility) Tested up to WordPress 6.0
225
  * (Core/Post Types) Added the `elementor-hf` post type to the `"hidden types"` list.
226
 
227
- = 2.8.11 =
228
- * (Options/Languages table) Added the `Frisian` flag image.
229
- * (Customizer) Exclude incompatible themes: `Mesmerize`, `Highlight`, and `Enfold`.
230
-
231
- = 2.8.10 =
232
- * (Core/Post Types) Added the `wp_navigation` post type to the `"hidden types"` list.
233
- * (Core/Options) Updated the compatibility info.
234
- * (Options/Languages table) Added `Frisian` language.
235
-
236
- = 2.8.9 =
237
- * (Vendors) Updated doc.
238
- * (Configs) Updated `rank-math-seo.json` file.
239
- * (Core/WPGlobus) Updated doc.
240
- * (Core/WPGlobus_WP) Added `is_rest_api_request` function.
241
- * (Core/Builders) Added: builder attributes.
242
- * (Core/Meta) Added: support term meta data.
243
- * (Core/Config) Added: support REST API requests.
244
- * (Builder/Config) Set builder language for REST API requests.
245
- * (Vendor/Config) Added: handling term meta fields.
246
- * (Vendor/Yoast) Filter taxonomy term name in the `Schema Generator`.
247
- * (Vendor/RankMathSEO) Don't check post IDs.
248
- * (Builders/RankMathSEO) Added: support multilingual columns on `edit.php` page.
249
- * (Builders/RankMathSEO) Added: support for the REST API requests.
250
-
251
  == Demo Sites ==
252
 
253
  * [WPGlobus.com](https://wpglobus.com/):
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.5
6
+ Tested up to: 6.0
7
  Requires PHP: 5.6
8
  Stable tag: trunk
9
  License: GPL-3.0-or-later
113
  * [WooCommerce and some of its extensions](https://wpglobus.com/product/woocommerce-wpglobus/),
114
  * [WooCommerce Nets Netaxept Payment Plugin](https://wpglobus.com/product/multilingual-woocommerce-nets-netaxept/)
115
 
 
 
116
  = Permalinks =
117
 
118
  **IMPORTANT:** WPGlobus will not work if your URLs look like `example.com?p=123` or `example.com/index.php/category/post/`.
218
 
219
  == Changelog ==
220
 
221
+ = 2.10.1 =
222
+ * (Vendor/Yoast) Added filters for the user Open Graph title and description, Schema Graph name and description.
223
+ * (Core) Fixed PHP 8.1 notice about `add_submenu_page()` parameter.
224
+
225
  = 2.10.0 =
226
  * (Compatibility) Tested up to WordPress 6.0
227
  * (Core/Post Types) Added the `elementor-hf` post type to the `"hidden types"` list.
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  == Demo Sites ==
230
 
231
  * [WPGlobus.com](https://wpglobus.com/):
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.10.0
19
  * Author: WPGlobus
20
  * Author URI: https://wpglobus.com/
21
  * Network: false
@@ -44,7 +44,7 @@ if ( ! defined( 'ABSPATH' ) ) {
44
  exit;
45
  }
46
 
47
- define( 'WPGLOBUS_VERSION', '2.10.0' );
48
  define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
49
  define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
50
 
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.10.1
19
  * Author: WPGlobus
20
  * Author URI: https://wpglobus.com/
21
  * Network: false
44
  exit;
45
  }
46
 
47
+ define( 'WPGLOBUS_VERSION', '2.10.1' );
48
  define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
49
  define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
50