Polylang Connect for Elementor – Templates Translation & Language Switcher - Version 2.3.2

Version Description

  • Fix dynamic tag image language flag don't return svg scalable file.
  • Fix Language Switcher dropdown styles with many languages.
  • Fix PHP error undefined array key "HTTP_REFERER" (thanks to @nicomollet).
Download this release

Release Info

Developer pacotole
Plugin Icon 128x128 Polylang Connect for Elementor – Templates Translation & Language Switcher
Version 2.3.2
Comparing to
See all releases

Code changes from version 2.3.1 to 2.3.2

README.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: daveshine, p4fbradjohnson, deckerweb, wpautobahn, pacotole, creapu
3
  Donate link: https://www.paypal.me/pacotole
4
  Tags: elementor, polylang, multilingual, language switcher, languages, templates, widget, finder, dynamic tags
5
  Requires at least: 5.4
6
- Tested up to: 6.0
7
  Requires PHP: 5.6
8
- Stable tag: 2.3.1
9
  License: GPL-2.0-or-later
10
  License URI: https://opensource.org/licenses/GPL-2.0
11
 
@@ -20,7 +20,7 @@ Connect Polylang multilingual plugin with Elementor Page Builder: **Translate yo
20
  ### What the Plugin Does
21
 
22
  #### 📍 Template translation and show in the correct language
23
- Create translations for your Elementor templates especially for header, footer or archive templates with [**Elementor Pro Theme Builder**](https://trk.elementor.com/5l8mc0eyt38p-theme-builder) *(affiliated link)*.
24
 
25
  It also works and selects the correct translation when using the `[elementor-template]` shortcode.
26
 
@@ -114,7 +114,7 @@ Please, send your suggestions and feedback - Thank you for using or trying out t
114
 
115
  * WordPress version 4.7 or higher
116
  * [Elementor](https://wordpress.org/plugins/elementor/) and [Polylang](https://wordpress.org/plugins/polylang/) plugins - free versions from WordPress.org Plugin Directory
117
- * **Recommended:** [**Elementor Pro**](https://trk.elementor.com/5l8mc0eyt38p) *(affiliate link)* which is needed for Theme Building possibilities (header, footer, 404, archive templates, etc.) and Dynamic Tags.
118
 
119
  = Installation =
120
 
@@ -149,7 +149,7 @@ This plugin has NO settings page, as it does not need one. All it does works jus
149
  = Is Elementor Pro required? =
150
  Technically, Elementor Pro is not required **but highly recommended**.
151
 
152
- [**Elementor Pro**](https://trk.elementor.com/5l8mc0eyt38p-pro) *(affiliate link)* is required for these features of the plugin:
153
 
154
  * Translate Elementor Theme Builder Templates (header, footer, 404, page, archives).
155
  * Translate Elementor Popups.
@@ -180,6 +180,7 @@ There are quite a few:
180
 
181
  * [**Polylang Pro** (Premium)](https://polylang.pro/downloads/polylang-pro/) - The official premium version with more features, plus premium support
182
  * [**Polylang for WooCommerce** (Premium)](https://polylang.pro/downloads/polylang-for-woocommerce/) - Makes WooCommerce multilingual - official Polylang Add-On
 
183
  * [**Lingotek Translation**](https://wordpress.org/plugins/lingotek-translation/) - Native Polylang integration - Lingotek brings convenient cloud-based localization and translation for WordPress
184
  * [**Elementor Datepicker Localization**](https://github.com/creame/elementor-datepicker-localization) - Allow form datetime fields in your site language
185
  * [**Country Flags for Elementor**](https://wordpress.org/plugins/country-flags-for-elementor/) - Native Elementor widget
@@ -197,6 +198,11 @@ There are quite a few:
197
 
198
  == Changelog ==
199
 
 
 
 
 
 
200
  = 2.3.1 =
201
  * Fix Widget initialization on Elementor 3.7
202
 
3
  Donate link: https://www.paypal.me/pacotole
4
  Tags: elementor, polylang, multilingual, language switcher, languages, templates, widget, finder, dynamic tags
5
  Requires at least: 5.4
6
+ Tested up to: 6.1
7
  Requires PHP: 5.6
8
+ Stable tag: 2.3.2
9
  License: GPL-2.0-or-later
10
  License URI: https://opensource.org/licenses/GPL-2.0
11
 
20
  ### What the Plugin Does
21
 
22
  #### 📍 Template translation and show in the correct language
23
+ Create translations for your Elementor templates especially for header, footer or archive templates with [**Elementor Pro Theme Builder**](https://be.elementor.com/visit/?bta=61741&nci=5383&utm_campaign=wporg) *(affiliated link)*.
24
 
25
  It also works and selects the correct translation when using the `[elementor-template]` shortcode.
26
 
114
 
115
  * WordPress version 4.7 or higher
116
  * [Elementor](https://wordpress.org/plugins/elementor/) and [Polylang](https://wordpress.org/plugins/polylang/) plugins - free versions from WordPress.org Plugin Directory
117
+ * **Recommended:** [**Elementor Pro**](https://be.elementor.com/visit/?bta=61741&nci=5383&utm_campaign=wporg) *(affiliate link)* which is needed for Theme Building possibilities (header, footer, 404, archive templates, etc.) and Dynamic Tags.
118
 
119
  = Installation =
120
 
149
  = Is Elementor Pro required? =
150
  Technically, Elementor Pro is not required **but highly recommended**.
151
 
152
+ [**Elementor Pro**](https://be.elementor.com/visit/?bta=61741&nci=5383&utm_campaign=wporg) *(affiliate link)* is required for these features of the plugin:
153
 
154
  * Translate Elementor Theme Builder Templates (header, footer, 404, page, archives).
155
  * Translate Elementor Popups.
180
 
181
  * [**Polylang Pro** (Premium)](https://polylang.pro/downloads/polylang-pro/) - The official premium version with more features, plus premium support
182
  * [**Polylang for WooCommerce** (Premium)](https://polylang.pro/downloads/polylang-for-woocommerce/) - Makes WooCommerce multilingual - official Polylang Add-On
183
+ * [**Polylang Slug**](https://github.com/grappler/polylang-slug) - Allows same slug for multiple languages in Polylang
184
  * [**Lingotek Translation**](https://wordpress.org/plugins/lingotek-translation/) - Native Polylang integration - Lingotek brings convenient cloud-based localization and translation for WordPress
185
  * [**Elementor Datepicker Localization**](https://github.com/creame/elementor-datepicker-localization) - Allow form datetime fields in your site language
186
  * [**Country Flags for Elementor**](https://wordpress.org/plugins/country-flags-for-elementor/) - Native Elementor widget
198
 
199
  == Changelog ==
200
 
201
+ = 2.3.2 =
202
+ * Fix dynamic tag image language flag don't return svg scalable file.
203
+ * Fix Language Switcher dropdown styles with many languages.
204
+ * Fix PHP error undefined array key "HTTP_REFERER" (thanks to @nicomollet).
205
+
206
  = 2.3.1 =
207
  * Fix Widget initialization on Elementor 3.7
208
 
assets/css/language-switcher.css CHANGED
@@ -30,6 +30,7 @@
30
  /* Dropdown layout */
31
  .cpel-switcher--layout-dropdown {
32
  --rotate: 0deg;
 
33
  }
34
 
35
  .cpel-switcher--drop-to-up {
@@ -111,7 +112,7 @@
111
  }
112
 
113
  .cpel-switcher--layout-dropdown .cpel-switcher__toggle--on+.cpel-switcher__list {
114
- max-height: 300px;
115
  transition: max-height 400ms ease-in;
116
  }
117
 
@@ -136,7 +137,7 @@
136
  }
137
 
138
  .cpel-switcher--drop-on-hover .cpel-switcher__nav:hover .cpel-switcher__list {
139
- max-height: 300px;
140
  transition: max-height 400ms ease-in;
141
  }
142
  }
30
  /* Dropdown layout */
31
  .cpel-switcher--layout-dropdown {
32
  --rotate: 0deg;
33
+ --langs: 5;
34
  }
35
 
36
  .cpel-switcher--drop-to-up {
112
  }
113
 
114
  .cpel-switcher--layout-dropdown .cpel-switcher__toggle--on+.cpel-switcher__list {
115
+ max-height: calc(100% * var(--langs));
116
  transition: max-height 400ms ease-in;
117
  }
118
 
137
  }
138
 
139
  .cpel-switcher--drop-on-hover .cpel-switcher__nav:hover .cpel-switcher__list {
140
+ max-height: calc(100% * var(--langs));
141
  transition: max-height 400ms ease-in;
142
  }
143
  }
assets/css/language-switcher.min.css CHANGED
@@ -1 +1 @@
1
- .cpel-switcher__nav{--cpel-switcher-space:0;display:block}.cpel-switcher__nav .cpel-switcher__list{display:flex;list-style:none;margin:0;padding:0;line-height:normal;-webkit-tap-highlight-color:rgba(0,0,0,0)}.cpel-switcher__nav a{display:inline-block;text-decoration:none;white-space:nowrap}.cpel-switcher--layout-horizontal .cpel-switcher__list{flex-direction:row;flex-wrap:wrap}.cpel-switcher--layout-vertical .cpel-switcher__list{flex-direction:column}.cpel-switcher--layout-dropdown{--rotate:0}.cpel-switcher--drop-to-up{--rotate:180deg}.cpel-switcher--layout-dropdown .cpel-switcher__nav{display:inline-block;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.cpel-switcher--layout-dropdown .cpel-switcher__toggle{position:relative}.cpel-switcher--layout-dropdown .cpel-switcher__toggle::after{content:'';position:absolute;z-index:2;top:0;right:0;bottom:0;width:100%;cursor:pointer}.cpel-switcher--layout-dropdown .cpel-switcher__toggle a i{vertical-align:middle;transform:rotateX(var(--rotate));transition:transform 0s 200ms}.cpel-switcher--layout-dropdown .cpel-switcher__toggle.cpel-switcher__toggle--on::after{width:min(33%,2.5em)}.cpel-switcher--layout-dropdown .cpel-switcher__toggle.cpel-switcher__toggle--on a i{transform:rotateX(calc(var(--rotate) + 180deg));transition-delay:0s}.cpel-switcher--layout-dropdown.cpel-switcher--align-left .elementor-widget-container{text-align:left}.cpel-switcher--layout-dropdown.cpel-switcher--align-center .elementor-widget-container{text-align:center}.cpel-switcher--layout-dropdown.cpel-switcher--align-right .elementor-widget-container{text-align:right}.cpel-switcher--layout-dropdown.cpel-switcher--align-justify .cpel-switcher__nav{display:flex}.cpel-switcher--layout-dropdown .cpel-switcher__list{position:absolute;z-index:10;top:100%;display:flex;flex-direction:column;justify-content:flex-end;min-width:100%;max-height:0;overflow:hidden;transition:max-height 300ms ease-out}.cpel-switcher--drop-to-up .cpel-switcher__list{top:auto;bottom:100%;justify-content:flex-start}.cpel-switcher--layout-dropdown .cpel-switcher__toggle--on+.cpel-switcher__list{max-height:300px;transition:max-height 400ms ease-in}.cpel-switcher--layout-dropdown .cpel-switcher__lang{width:100%}.cpel-switcher--layout-dropdown .cpel-switcher__lang a{display:block;text-align:left}@media(pointer:fine){.cpel-switcher--drop-on-hover .cpel-switcher__nav:hover .cpel-switcher__toggle::after{width:min(33%,2.5em)}.cpel-switcher--drop-on-hover .cpel-switcher__nav:hover .cpel-switcher__toggle a i{transform:rotateX(calc(var(--rotate) + 180deg));transition-delay:0s}.cpel-switcher--drop-on-hover .cpel-switcher__nav:hover .cpel-switcher__list{max-height:300px;transition:max-height 400ms ease-in}}.cpel-switcher--align-left .cpel-switcher__list{align-items:flex-start}.cpel-switcher--align-center .cpel-switcher__list{align-items:center}.cpel-switcher--align-right .cpel-switcher__list{align-items:flex-end}.cpel-switcher--align-justify .cpel-switcher__list{align-items:stretch}.cpel-switcher--align-justify a{width:100%;text-align:center}.cpel-switcher--layout-dropdown.cpel-switcher--align-right .cpel-switcher__list{right:0;left:auto}.cpel-switcher--layout-dropdown.cpel-switcher--align-justify .cpel-switcher__toggle a{display:inline-flex;justify-content:flex-start;align-items:center}.cpel-switcher--layout-dropdown.cpel-switcher--align-justify .cpel-switcher__icon{margin-right:0;margin-left:auto}.cpel-switcher--layout-horizontal.cpel-switcher--align-left .cpel-switcher__list{justify-content:flex-start}.cpel-switcher--layout-horizontal.cpel-switcher--align-center .cpel-switcher__list{justify-content:center}.cpel-switcher--layout-horizontal.cpel-switcher--align-right .cpel-switcher__list{justify-content:flex-end}.cpel-switcher--layout-horizontal.cpel-switcher--align-justify .cpel-switcher__lang{flex-grow:1}.cpel-switcher__lang{margin:0}.cpel-switcher--layout-horizontal .cpel-switcher__lang:not(:last-child){margin-right:var(--cpel-switcher-space)}body.rtl .cpel-switcher--layout-horizontal .cpel-switcher__lang:not(:last-child){margin-left:var(--cpel-switcher-space)}.cpel-switcher--layout-vertical .cpel-switcher__lang:not(:last-child){margin-bottom:var(--cpel-switcher-space)}.cpel-switcher__name,.cpel-switcher__code,.cpel-switcher__flag{display:inline-block;vertical-align:middle}.cpel-switcher__name,.cpel-switcher__code{text-decoration:inherit}.cpel-switcher__flag{line-height:.5em}.cpel-switcher__flag img{width:100%;max-width:100%;height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center}.cpel-switcher__flag--ai img,.cpel-switcher__flag--au img,.cpel-switcher__flag--aw img,.cpel-switcher__flag--bm img,.cpel-switcher__flag--bs img,.cpel-switcher__flag--by img,.cpel-switcher__flag--cd img,.cpel-switcher__flag--ck img,.cpel-switcher__flag--cl img,.cpel-switcher__flag--cn img,.cpel-switcher__flag--cu img,.cpel-switcher__flag--cz img,.cpel-switcher__flag--dj img,.cpel-switcher__flag--er img,.cpel-switcher__flag--esperanto img,.cpel-switcher__flag--es img,.cpel-switcher__flag--fj img,.cpel-switcher__flag--fk img,.cpel-switcher__flag--gq img,.cpel-switcher__flag--gr img,.cpel-switcher__flag--gs img,.cpel-switcher__flag--gw img,.cpel-switcher__flag--gy img,.cpel-switcher__flag--hm img,.cpel-switcher__flag--io img,.cpel-switcher__flag--jo img,.cpel-switcher__flag--km img,.cpel-switcher__flag--kw img,.cpel-switcher__flag--ky img,.cpel-switcher__flag--kz img,.cpel-switcher__flag--lk img,.cpel-switcher__flag--lr img,.cpel-switcher__flag--mg img,.cpel-switcher__flag--mh img,.cpel-switcher__flag--ms img,.cpel-switcher__flag--my img,.cpel-switcher__flag--mz img,.cpel-switcher__flag--na img,.cpel-switcher__flag--np img,.cpel-switcher__flag--nu img,.cpel-switcher__flag--nz img,.cpel-switcher__flag--om img,.cpel-switcher__flag--ph img,.cpel-switcher__flag--pm img,.cpel-switcher__flag--pn img,.cpel-switcher__flag--pr img,.cpel-switcher__flag--ps img,.cpel-switcher__flag--sb img,.cpel-switcher__flag--sc img,.cpel-switcher__flag--sd img,.cpel-switcher__flag--sg img,.cpel-switcher__flag--sh img,.cpel-switcher__flag--sk img,.cpel-switcher__flag--ss img,.cpel-switcher__flag--st img,.cpel-switcher__flag--tc img,.cpel-switcher__flag--tf img,.cpel-switcher__flag--tg img,.cpel-switcher__flag--tk img,.cpel-switcher__flag--tl img,.cpel-switcher__flag--to img,.cpel-switcher__flag--tv img,.cpel-switcher__flag--tw img,.cpel-switcher__flag--us img,.cpel-switcher__flag--uy img,.cpel-switcher__flag--uz img,.cpel-switcher__flag--vg img,.cpel-switcher__flag--vu img,.cpel-switcher__flag--za img,.cpel-switcher__flag--ws img,.cpel-switcher__flag--zw img{-o-object-position:left;object-position:left}.cpel-switcher__flag--eh img,.cpel-switcher__flag--tm img{-o-object-position:20%;object-position:20%}.cpel-switcher__flag--ai img,.cpel-switcher__flag--au img,.cpel-switcher__flag--bm img,.cpel-switcher__flag--ck img,.cpel-switcher__flag--fj img,.cpel-switcher__flag--fk img,.cpel-switcher__flag--gs img,.cpel-switcher__flag--hm img,.cpel-switcher__flag--io img,.cpel-switcher__flag--ky img,.cpel-switcher__flag--ms img,.cpel-switcher__flag--nu img,.cpel-switcher__flag--nz img,.cpel-switcher__flag--pn img,.cpel-switcher__flag--sh img,.cpel-switcher__flag--tc img,.cpel-switcher__flag--tf img,.cpel-switcher__flag--tv img,.cpel-switcher__flag--vg img{-o-object-position:75%;object-position:75%}.cpel-switcher__flag--as img,.cpel-switcher__flag--zm img{-o-object-position:right;object-position:right}
1
+ .cpel-switcher__nav{--cpel-switcher-space:0;display:block}.cpel-switcher__nav .cpel-switcher__list{display:flex;list-style:none;margin:0;padding:0;line-height:normal;-webkit-tap-highlight-color:rgba(0,0,0,0)}.cpel-switcher__nav a{display:inline-block;text-decoration:none;white-space:nowrap}.cpel-switcher--layout-horizontal .cpel-switcher__list{flex-direction:row;flex-wrap:wrap}.cpel-switcher--layout-vertical .cpel-switcher__list{flex-direction:column}.cpel-switcher--layout-dropdown{--rotate:0deg;--langs:5}.cpel-switcher--drop-to-up{--rotate:180deg}.cpel-switcher--layout-dropdown .cpel-switcher__nav{display:inline-block;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.cpel-switcher--layout-dropdown .cpel-switcher__toggle{position:relative}.cpel-switcher--layout-dropdown .cpel-switcher__toggle:after{content:"";position:absolute;z-index:2;top:0;right:0;bottom:0;width:100%;cursor:pointer}.cpel-switcher--layout-dropdown .cpel-switcher__toggle a i{vertical-align:middle;transform:rotateX(var(--rotate));transition:transform 0s .2s}.cpel-switcher--layout-dropdown .cpel-switcher__toggle.cpel-switcher__toggle--on:after{width:min(33%,2.5em)}.cpel-switcher--layout-dropdown .cpel-switcher__toggle.cpel-switcher__toggle--on a i{transform:rotateX(calc(var(--rotate) + 180deg));transition-delay:0s}.cpel-switcher--layout-dropdown.cpel-switcher--align-left .elementor-widget-container{text-align:left}.cpel-switcher--layout-dropdown.cpel-switcher--align-center .elementor-widget-container{text-align:center}.cpel-switcher--layout-dropdown.cpel-switcher--align-right .elementor-widget-container{text-align:right}.cpel-switcher--layout-dropdown.cpel-switcher--align-justify .cpel-switcher__nav{display:flex}.cpel-switcher--layout-dropdown .cpel-switcher__list{position:absolute;z-index:10;top:100%;display:flex;flex-direction:column;justify-content:flex-end;min-width:100%;max-height:0;overflow:hidden;transition:max-height .3s ease-out}.cpel-switcher--drop-to-up .cpel-switcher__list{top:auto;bottom:100%;justify-content:flex-start}.cpel-switcher--layout-dropdown .cpel-switcher__toggle--on+.cpel-switcher__list{max-height:calc(100% * var(--langs));transition:max-height .4s ease-in}.cpel-switcher--layout-dropdown .cpel-switcher__lang{width:100%}.cpel-switcher--layout-dropdown .cpel-switcher__lang a{display:block;text-align:left}@media (pointer:fine){.cpel-switcher--drop-on-hover .cpel-switcher__nav:hover .cpel-switcher__toggle:after{width:min(33%,2.5em)}.cpel-switcher--drop-on-hover .cpel-switcher__nav:hover .cpel-switcher__toggle a i{transform:rotateX(calc(var(--rotate) + 180deg));transition-delay:0s}.cpel-switcher--drop-on-hover .cpel-switcher__nav:hover .cpel-switcher__list{max-height:calc(100% * var(--langs));transition:max-height .4s ease-in}}.cpel-switcher--align-left .cpel-switcher__list{align-items:flex-start}.cpel-switcher--align-center .cpel-switcher__list{align-items:center}.cpel-switcher--align-right .cpel-switcher__list{align-items:flex-end}.cpel-switcher--align-justify .cpel-switcher__list{align-items:stretch}.cpel-switcher--align-justify a{width:100%;text-align:center}.cpel-switcher--layout-dropdown.cpel-switcher--align-right .cpel-switcher__list{right:0;left:auto}.cpel-switcher--layout-dropdown.cpel-switcher--align-justify .cpel-switcher__toggle a{display:inline-flex;justify-content:flex-start;align-items:center}.cpel-switcher--layout-dropdown.cpel-switcher--align-justify .cpel-switcher__icon{margin-right:0;margin-left:auto}.cpel-switcher--layout-horizontal.cpel-switcher--align-left .cpel-switcher__list{justify-content:flex-start}.cpel-switcher--layout-horizontal.cpel-switcher--align-center .cpel-switcher__list{justify-content:center}.cpel-switcher--layout-horizontal.cpel-switcher--align-right .cpel-switcher__list{justify-content:flex-end}.cpel-switcher--layout-horizontal.cpel-switcher--align-justify .cpel-switcher__lang{flex-grow:1}.cpel-switcher__lang{margin:0}.cpel-switcher--layout-horizontal .cpel-switcher__lang:not(:last-child){margin-right:var(--cpel-switcher-space)}body.rtl .cpel-switcher--layout-horizontal .cpel-switcher__lang:not(:last-child){margin-left:var(--cpel-switcher-space)}.cpel-switcher--layout-vertical .cpel-switcher__lang:not(:last-child){margin-bottom:var(--cpel-switcher-space)}.cpel-switcher__code,.cpel-switcher__flag,.cpel-switcher__name{display:inline-block;vertical-align:middle}.cpel-switcher__code,.cpel-switcher__name{text-decoration:inherit}.cpel-switcher__flag{line-height:.5em}.cpel-switcher__flag img{width:100%;max-width:100%;height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center}.cpel-switcher__flag--ai img,.cpel-switcher__flag--au img,.cpel-switcher__flag--aw img,.cpel-switcher__flag--bm img,.cpel-switcher__flag--bs img,.cpel-switcher__flag--by img,.cpel-switcher__flag--cd img,.cpel-switcher__flag--ck img,.cpel-switcher__flag--cl img,.cpel-switcher__flag--cn img,.cpel-switcher__flag--cu img,.cpel-switcher__flag--cz img,.cpel-switcher__flag--dj img,.cpel-switcher__flag--er img,.cpel-switcher__flag--es img,.cpel-switcher__flag--esperanto img,.cpel-switcher__flag--fj img,.cpel-switcher__flag--fk img,.cpel-switcher__flag--gq img,.cpel-switcher__flag--gr img,.cpel-switcher__flag--gs img,.cpel-switcher__flag--gw img,.cpel-switcher__flag--gy img,.cpel-switcher__flag--hm img,.cpel-switcher__flag--io img,.cpel-switcher__flag--jo img,.cpel-switcher__flag--km img,.cpel-switcher__flag--kw img,.cpel-switcher__flag--ky img,.cpel-switcher__flag--kz img,.cpel-switcher__flag--lk img,.cpel-switcher__flag--lr img,.cpel-switcher__flag--mg img,.cpel-switcher__flag--mh img,.cpel-switcher__flag--ms img,.cpel-switcher__flag--my img,.cpel-switcher__flag--mz img,.cpel-switcher__flag--na img,.cpel-switcher__flag--np img,.cpel-switcher__flag--nu img,.cpel-switcher__flag--nz img,.cpel-switcher__flag--om img,.cpel-switcher__flag--ph img,.cpel-switcher__flag--pm img,.cpel-switcher__flag--pn img,.cpel-switcher__flag--pr img,.cpel-switcher__flag--ps img,.cpel-switcher__flag--sb img,.cpel-switcher__flag--sc img,.cpel-switcher__flag--sd img,.cpel-switcher__flag--sg img,.cpel-switcher__flag--sh img,.cpel-switcher__flag--sk img,.cpel-switcher__flag--ss img,.cpel-switcher__flag--st img,.cpel-switcher__flag--tc img,.cpel-switcher__flag--tf img,.cpel-switcher__flag--tg img,.cpel-switcher__flag--tk img,.cpel-switcher__flag--tl img,.cpel-switcher__flag--to img,.cpel-switcher__flag--tv img,.cpel-switcher__flag--tw img,.cpel-switcher__flag--us img,.cpel-switcher__flag--uy img,.cpel-switcher__flag--uz img,.cpel-switcher__flag--vg img,.cpel-switcher__flag--vu img,.cpel-switcher__flag--ws img,.cpel-switcher__flag--za img,.cpel-switcher__flag--zw img{-o-object-position:left;object-position:left}.cpel-switcher__flag--eh img,.cpel-switcher__flag--tm img{-o-object-position:20%;object-position:20%}.cpel-switcher__flag--ai img,.cpel-switcher__flag--au img,.cpel-switcher__flag--bm img,.cpel-switcher__flag--ck img,.cpel-switcher__flag--fj img,.cpel-switcher__flag--fk img,.cpel-switcher__flag--gs img,.cpel-switcher__flag--hm img,.cpel-switcher__flag--io img,.cpel-switcher__flag--ky img,.cpel-switcher__flag--ms img,.cpel-switcher__flag--nu img,.cpel-switcher__flag--nz img,.cpel-switcher__flag--pn img,.cpel-switcher__flag--sh img,.cpel-switcher__flag--tc img,.cpel-switcher__flag--tf img,.cpel-switcher__flag--tv img,.cpel-switcher__flag--vg img{-o-object-position:75%;object-position:75%}.cpel-switcher__flag--as img,.cpel-switcher__flag--zm img{-o-object-position:right;object-position:right}
connect-polylang-elementor.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: Polylang Connect for Elementor
11
  * Plugin URI: https://github.com/creame/connect-polylang-elementor
12
  * Description: Connect Polylang with Elementor. Display templates in the correct language, language switcher widget, language visibility conditions and dynamic tags.
13
- * Version: 2.3.1
14
  * Author: Creame
15
  * Author URI: https://crea.me/
16
  * License: GPL-2.0-or-later
@@ -19,8 +19,8 @@
19
  * Domain Path: /languages/
20
  * Requires WP: 5.4
21
  * Requires PHP: 5.6
22
- * Elementor tested up to: 3.6.7
23
- * Elementor Pro tested up to: 3.7.2
24
  *
25
  * Copyright (c) 2021 Paco Toledo - CREAME
26
  * Copyright (c) 2018-2021 David Decker - DECKERWEB
@@ -36,7 +36,7 @@ defined( 'ABSPATH' ) || exit;
36
  *
37
  * @since 2.0.0
38
  */
39
- define( 'CPEL_PLUGIN_VERSION', '2.3.1' );
40
  define( 'CPEL_FILE', __FILE__ );
41
  define( 'CPEL_DIR', plugin_dir_path( CPEL_FILE ) );
42
  define( 'CPEL_BASENAME', plugin_basename( CPEL_FILE ) );
10
  * Plugin Name: Polylang Connect for Elementor
11
  * Plugin URI: https://github.com/creame/connect-polylang-elementor
12
  * Description: Connect Polylang with Elementor. Display templates in the correct language, language switcher widget, language visibility conditions and dynamic tags.
13
+ * Version: 2.3.2
14
  * Author: Creame
15
  * Author URI: https://crea.me/
16
  * License: GPL-2.0-or-later
19
  * Domain Path: /languages/
20
  * Requires WP: 5.4
21
  * Requires PHP: 5.6
22
+ * Elementor tested up to: 3.7.7
23
+ * Elementor Pro tested up to: 3.7.7
24
  *
25
  * Copyright (c) 2021 Paco Toledo - CREAME
26
  * Copyright (c) 2018-2021 David Decker - DECKERWEB
36
  *
37
  * @since 2.0.0
38
  */
39
+ define( 'CPEL_PLUGIN_VERSION', '2.3.2' );
40
  define( 'CPEL_FILE', __FILE__ );
41
  define( 'CPEL_DIR', plugin_dir_path( CPEL_FILE ) );
42
  define( 'CPEL_BASENAME', plugin_basename( CPEL_FILE ) );
includes/connect-plugins.php CHANGED
@@ -242,7 +242,7 @@ class ConnectPlugins {
242
  $translation = null;
243
 
244
  // Is API REST '/wp-json/elementor/v1/globals'.
245
- if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
246
  // Referrer is Elementor Editor?
247
  wp_parse_str( wp_parse_url( $_SERVER['HTTP_REFERER'], PHP_URL_QUERY ), $query );
248
 
242
  $translation = null;
243
 
244
  // Is API REST '/wp-json/elementor/v1/globals'.
245
+ if ( defined( 'REST_REQUEST' ) && REST_REQUEST && isset( $_SERVER['HTTP_REFERER'] ) ) {
246
  // Referrer is Elementor Editor?
247
  wp_parse_str( wp_parse_url( $_SERVER['HTTP_REFERER'], PHP_URL_QUERY ), $query );
248
 
includes/dynamic-tags/language-flag.php CHANGED
@@ -67,8 +67,9 @@ class LanguageFlag extends Data_Tag {
67
  );
68
 
69
  if ( 'yes' === $settings['svg_flag'] ) {
70
- $flag_svg = cpel_flag_svg( $image_data['url'] );
71
- $image_data['url'] = isset( $flag_svg['url'] ) ? $flag_svg['url'] : $image_data['url'];
 
72
  }
73
 
74
  return $image_data;
67
  );
68
 
69
  if ( 'yes' === $settings['svg_flag'] ) {
70
+ $flag_code = cpel_flag_code( $image_data['url'] );
71
+ $flag_svg = $flag_code ? cpel_flag_svg( $flag_code ) : false;
72
+ $image_data['url'] = $flag_svg ? $flag_svg['url'] : $image_data['url'];
73
  }
74
 
75
  return $image_data;
includes/widgets/polylang-language-switcher.php CHANGED
@@ -732,6 +732,11 @@ class PolylangLanguageSwitcher extends Widget_Base {
732
  $languages = pll_the_languages( array( 'raw' => 1 ) );
733
  $lang_curr = strtolower( pll_current_language() );
734
 
 
 
 
 
 
735
  if ( ! empty( $languages ) ) {
736
 
737
  $lang_links = array();
732
  $languages = pll_the_languages( array( 'raw' => 1 ) );
733
  $lang_curr = strtolower( pll_current_language() );
734
 
735
+ // Max number of items in language dropdown
736
+ if ( 'dropdown' === $settings['layout'] ) {
737
+ $this->add_render_attribute( '_wrapper', 'style', '--langs:' . ( count( $languages ) - 1 ) );
738
+ }
739
+
740
  if ( ! empty( $languages ) ) {
741
 
742
  $lang_links = array();
languages/connect-polylang-elementor.pot CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the GPL-2.0-or-later.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Polylang Connect for Elementor 2.3.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/connect-polylang-elementor\n"
7
  "Last-Translator: Pacotole <pacotole@crea.me>\n"
8
  "Language-Team: Creame <hola@crea.me>\n"
2
  # This file is distributed under the GPL-2.0-or-later.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Polylang Connect for Elementor 2.3.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/connect-polylang-elementor\n"
7
  "Last-Translator: Pacotole <pacotole@crea.me>\n"
8
  "Language-Team: Creame <hola@crea.me>\n"