Polylang - Version 1.7.9

Version Description

(2015-08-17) =

  • Minimum WordPress version is now v3.9
  • Add: hreflang="x-default" on front page when the default language code is not hidden in urls
  • fix: remove hreflang links in html head section of paged archives to please Google
  • fix: conflict with WPSEO sitemap caching when using multiple domains. props Junaid Bhura
  • fix: change the order of strings translations columns for better display on mobile devices in WP 4.3
  • fix: various issues with nav menus and customizer in WP 4.3
  • fix: correctly disallow unchecking both show names and show flags in the language switcher form
Download this release

Release Info

Developer Chouby
Plugin Icon 128x128 Polylang
Version 1.7.9
Comparing to
See all releases

Code changes from version 1.7.8 to 1.7.9

admin/admin-filters-columns.php CHANGED
@@ -61,8 +61,9 @@ class PLL_Admin_Filters_Columns {
61
 
62
  foreach ($this->model->get_languages_list() as $language) {
63
  // don't add the column for the filtered language
64
- if (empty($this->curlang) || $language->slug != $this->curlang->slug)
65
- $columns['language_'.$language->slug] = $language->flag ? $language->flag : esc_html($language->slug);
 
66
  }
67
 
68
  return isset($end) ? array_merge($columns, $end) : $columns;
61
 
62
  foreach ($this->model->get_languages_list() as $language) {
63
  // don't add the column for the filtered language
64
+ if (empty($this->curlang) || $language->slug != $this->curlang->slug) {
65
+ $columns['language_'.$language->slug] = $language->flag ? $language->flag . '<span class="screen-reader-text">' . $language->name . '</span>' : esc_html($language->slug);
66
+ }
67
  }
68
 
69
  return isset($end) ? array_merge($columns, $end) : $columns;
admin/admin-filters-term.php CHANGED
@@ -558,17 +558,25 @@ class PLL_Admin_Filters_Term {
558
  if (isset($screen) && in_array($screen->base, array('toplevel_page_mlang', 'dashboard')))
559
  return false;
560
 
561
- // admin language filter for ajax paginate_links in taxonomies metabox in nav menus panel
562
- if (!empty($_POST['action']) && !empty($this->curlang) && 'menu-get-metabox' == $_POST['action'])
563
- return $this->curlang;
 
 
 
 
 
564
 
565
- // The only ajax response I want to deal with is when changing the language in post metabox
566
- if (isset($_POST['action']) && !in_array($_POST['action'], array('post_lang_choice', 'term_lang_choice', 'get-tagcloud')))
567
- return false;
 
568
 
569
- // I only want to filter the parent dropdown list when editing a term in a hierarchical taxonomy
570
- if (isset($_POST['action']) && $_POST['action'] == 'term_lang_choice' && !(isset($args['class']) || isset($args['unit'])))
571
- return false;
 
 
572
 
573
  // ajax response for changing the language in the post metabox (or in the edit-tags panels)
574
  if (isset($_POST['lang']))
558
  if (isset($screen) && in_array($screen->base, array('toplevel_page_mlang', 'dashboard')))
559
  return false;
560
 
561
+ // ajax actions
562
+ if (isset($_POST['action'])) {
563
+ // admin language filter for:
564
+ // ajax paginate_links in taxonomies metabox in nav menus panel
565
+ // and taxonomies menus items in customizer menus (since WP 4.3)
566
+ if (!empty($this->curlang) && in_array($_POST['action'], array('menu-get-metabox', 'load-available-menu-items-customizer'))) {
567
+ return $this->curlang;
568
+ }
569
 
570
+ // The only ajax response I want to deal with is when changing the language in post metabox
571
+ if (!in_array($_POST['action'], array('post_lang_choice', 'term_lang_choice', 'get-tagcloud'))) {
572
+ return false;
573
+ }
574
 
575
+ // I only want to filter the parent dropdown list when editing a term in a hierarchical taxonomy
576
+ if ('term_lang_choice' == $_POST['action'] && !(isset($args['class']) || isset($args['unit']))) {
577
+ return false;
578
+ }
579
+ }
580
 
581
  // ajax response for changing the language in the post metabox (or in the edit-tags panels)
582
  if (isset($_POST['lang']))
admin/admin-nav-menu.php CHANGED
@@ -104,7 +104,7 @@ class PLL_Admin_Nav_Menu extends PLL_Nav_Menu {
104
  foreach (array_reverse(PLL_Switcher::get_switcher_options('menu', 'string')) as $str)
105
  $data['strings'][] = $str;
106
 
107
- $data['strings'][] = __('Language switcher', 'polylang'); // the title
108
 
109
  // get all language switcher menu items
110
  $items = get_posts(array(
104
  foreach (array_reverse(PLL_Switcher::get_switcher_options('menu', 'string')) as $str)
105
  $data['strings'][] = $str;
106
 
107
+ $data['title'] = __('Language switcher', 'polylang'); // the title
108
 
109
  // get all language switcher menu items
110
  $items = get_posts(array(
admin/table-string.php CHANGED
@@ -106,9 +106,9 @@ class PLL_Table_String extends WP_List_Table {
106
  function get_columns() {
107
  return array(
108
  'cb' => '<input type="checkbox" />', //checkbox
109
- 'context' => __('Group', 'polylang'),
110
- 'name' => __('Name', 'polylang'),
111
  'string' => __('String', 'polylang'),
 
 
112
  'translations' => __('Translations', 'polylang'),
113
  );
114
  }
@@ -122,9 +122,9 @@ class PLL_Table_String extends WP_List_Table {
122
  */
123
  function get_sortable_columns() {
124
  return array(
125
- 'context' => array('context', false),
126
- 'name' => array('name', false),
127
  'string' => array('string', false),
 
 
128
  );
129
  }
130
 
106
  function get_columns() {
107
  return array(
108
  'cb' => '<input type="checkbox" />', //checkbox
 
 
109
  'string' => __('String', 'polylang'),
110
+ 'name' => __('Name', 'polylang'),
111
+ 'context' => __('Group', 'polylang'),
112
  'translations' => __('Translations', 'polylang'),
113
  );
114
  }
122
  */
123
  function get_sortable_columns() {
124
  return array(
 
 
125
  'string' => array('string', false),
126
+ 'name' => array('name', false),
127
+ 'context' => array('context', false),
128
  );
129
  }
130
 
css/admin.css CHANGED
@@ -65,9 +65,9 @@
65
  /* language columns in edit.php and edit-tags.php */
66
  th[class*='column-language_'], td[class*='column-language_'] {
67
  width: 2em;
68
- text-align: center;
69
  }
70
 
 
71
  /* languages metabox in post.php */
72
  #post-translations table {
73
  table-layout: fixed;
@@ -177,26 +177,26 @@ th[class*='column-language_'], td[class*='column-language_'] {
177
  .stringstranslations .column-name {
178
  display: none;
179
  }
180
-
181
  /* hide selected language flag and translations language name */
182
  #select-add-term-language .pll-select-flag,
183
  #select-edit-term-language .pll-select-flag,
184
  #edit-term-translations .pll-language-name {
185
  display: none;
186
  }
187
-
188
  #edit-term-translations {
189
  width: 100%;
190
  }
191
 
192
  #add-term-translations .pll-language-column {
193
- line-height: 38px;
194
  }
195
-
196
  #edit-term-translations td {
197
  padding: 8px 10px;
198
  }
199
-
200
  #edit-term-translations .pll-language-column,
201
  #edit-term-translations .pll-edit-column {
202
  width: 20px;
@@ -208,11 +208,11 @@ th[class*='column-language_'], td[class*='column-language_'] {
208
  .term-translations .pll-translation-column {
209
  display: table-cell;
210
  }
211
-
212
  .term-translations .hidden {
213
  display: none;
214
  }
215
-
216
  /* admin bar */
217
  #wpadminbar li#wp-admin-bar-languages {
218
  display: block; /*shows our menu on mobile devices */
65
  /* language columns in edit.php and edit-tags.php */
66
  th[class*='column-language_'], td[class*='column-language_'] {
67
  width: 2em;
 
68
  }
69
 
70
+
71
  /* languages metabox in post.php */
72
  #post-translations table {
73
  table-layout: fixed;
177
  .stringstranslations .column-name {
178
  display: none;
179
  }
180
+
181
  /* hide selected language flag and translations language name */
182
  #select-add-term-language .pll-select-flag,
183
  #select-edit-term-language .pll-select-flag,
184
  #edit-term-translations .pll-language-name {
185
  display: none;
186
  }
187
+
188
  #edit-term-translations {
189
  width: 100%;
190
  }
191
 
192
  #add-term-translations .pll-language-column {
193
+ line-height: 38px;
194
  }
195
+
196
  #edit-term-translations td {
197
  padding: 8px 10px;
198
  }
199
+
200
  #edit-term-translations .pll-language-column,
201
  #edit-term-translations .pll-edit-column {
202
  width: 20px;
208
  .term-translations .pll-translation-column {
209
  display: table-cell;
210
  }
211
+
212
  .term-translations .hidden {
213
  display: none;
214
  }
215
+
216
  /* admin bar */
217
  #wpadminbar li#wp-admin-bar-languages {
218
  display: block; /*shows our menu on mobile devices */
css/admin.min.css CHANGED
@@ -1 +1 @@
1
- .column-term_group,.column-flag,.column-count{width:10%}.form-field input[type="radio"]{width:auto;margin-right:2px}#pll_about_box p,#pll_recommended p{text-align:justify}#pll_about_box input{margin:0;padding:0;float:right}#string-translation .search-box{margin:16px 0 8px 0}.stringstranslations .column-name,.stringstranslations .column-context{width:10%}.stringstranslations .column-string{width:33%}.translation label{display:inline-block;width:23%;vertical-align:top}.translation input,.translation textarea{width:72%}.pll_inline_block{margin:0}.pll_inline_block li{display:inline-block;margin:0;width:250px}#pll-domains-table td{padding:2px 2px 2px 1.5em}#pll-force-lang .description{margin-top:0;margin-bottom:.5em}th[class*='column-language_'],td[class*='column-language_']{width:2em;text-align:center}#post-translations table{table-layout:fixed;width:100%}#post-translations a{text-decoration:none}#post-translations .pll-language-column,#post-translations .pll-edit-column{width:20px}#post-translations td{padding:2px}#post-translations .spinner,#term-translations .spinner{float:none;margin:0;background-position:center;width:auto}.pll-edit-column{text-align:center}#select-post-language .pll-select-flag{padding:4px;margin-right:32px}#select-media-language .pll-select-flag{padding:4px;margin-right:10px}.pll-media-edit-column{float:right}.pll-translation-flag{margin-right:14px}#select-add-term-language .pll-select-flag{padding:11px;margin-right:13px}#select-edit-term-language .pll-select-flag{padding:11px;margin-right:4px}#add-term-translations,#edit-term-translations{width:95%}#term-translations .pll-language-column{line-height:28px;width:20%}#term-translations .pll-edit-column,#add-term-translations .pll-language-column{width:20px}.pll_icon_tick:before{content:"\f147"}.pll_icon_add:before{content:"\f132"}.pll_icon_edit:before{content:"\f464"}[class^="pll_icon_"]{font:20px/1 'dashicons';vertical-align:middle}#wpadminbar #wp-admin-bar-languages .ab-item img{margin:0 8px 0 2px}#wpadminbar #wp-admin-bar-languages #wp-admin-bar-all .ab-item .ab-icon{float:none;top:4px}#wpadminbar #wp-admin-bar-languages .ab-icon:before{content:"\f326";top:1px}@media screen and (max-width:782px){.stringstranslations .column-context,.stringstranslations .column-name{display:none}#select-add-term-language .pll-select-flag,#select-edit-term-language .pll-select-flag,#edit-term-translations .pll-language-name{display:none}#edit-term-translations{width:100%}#add-term-translations .pll-language-column{line-height:38px}#edit-term-translations td{padding:8px 10px}#edit-term-translations .pll-language-column,#edit-term-translations .pll-edit-column{width:20px}.term-translations .pll-language-column,.term-translations .pll-edit-column,.term-translations .pll-translation-column{display:table-cell}.term-translations .hidden{display:none}#wpadminbar li#wp-admin-bar-languages{display:block}#wpadminbar #wp-admin-bar-languages>.ab-item{width:50px;text-align:center}#wpadminbar #wp-admin-bar-languages>.ab-item .ab-icon:before{font:32px/1 'dashicons';top:-1px}#wpadminbar #wp-admin-bar-languages>.ab-item img{margin:19px 0}#wpadminbar #wp-admin-bar-languages #wp-admin-bar-all .ab-item .ab-icon{margin-right:6px;font-size:20px !important;line-height:20px !important}}
1
+ .column-term_group,.column-flag,.column-count{width:10%}.form-field input[type="radio"]{width:auto;margin-right:2px}#pll_about_box p,#pll_recommended p{text-align:justify}#pll_about_box input{margin:0;padding:0;float:right}#string-translation .search-box{margin:16px 0 8px 0}.stringstranslations .column-name,.stringstranslations .column-context{width:10%}.stringstranslations .column-string{width:33%}.translation label{display:inline-block;width:23%;vertical-align:top}.translation input,.translation textarea{width:72%}.pll_inline_block{margin:0}.pll_inline_block li{display:inline-block;margin:0;width:250px}#pll-domains-table td{padding:2px 2px 2px 1.5em}#pll-force-lang .description{margin-top:0;margin-bottom:.5em}th[class*='column-language_'],td[class*='column-language_']{width:2em}#post-translations table{table-layout:fixed;width:100%}#post-translations a{text-decoration:none}#post-translations .pll-language-column,#post-translations .pll-edit-column{width:20px}#post-translations td{padding:2px}#post-translations .spinner,#term-translations .spinner{float:none;margin:0;background-position:center;width:auto}.pll-edit-column{text-align:center}#select-post-language .pll-select-flag{padding:4px;margin-right:32px}#select-media-language .pll-select-flag{padding:4px;margin-right:10px}.pll-media-edit-column{float:right}.pll-translation-flag{margin-right:14px}#select-add-term-language .pll-select-flag{padding:11px;margin-right:13px}#select-edit-term-language .pll-select-flag{padding:11px;margin-right:4px}#add-term-translations,#edit-term-translations{width:95%}#term-translations .pll-language-column{line-height:28px;width:20%}#term-translations .pll-edit-column,#add-term-translations .pll-language-column{width:20px}.pll_icon_tick:before{content:"\f147"}.pll_icon_add:before{content:"\f132"}.pll_icon_edit:before{content:"\f464"}[class^="pll_icon_"]{font:20px/1 'dashicons';vertical-align:middle}#wpadminbar #wp-admin-bar-languages .ab-item img{margin:0 8px 0 2px}#wpadminbar #wp-admin-bar-languages #wp-admin-bar-all .ab-item .ab-icon{float:none;top:4px}#wpadminbar #wp-admin-bar-languages .ab-icon:before{content:"\f326";top:1px}@media screen and (max-width:782px){.stringstranslations .column-context,.stringstranslations .column-name{display:none}#select-add-term-language .pll-select-flag,#select-edit-term-language .pll-select-flag,#edit-term-translations .pll-language-name{display:none}#edit-term-translations{width:100%}#add-term-translations .pll-language-column{line-height:38px}#edit-term-translations td{padding:8px 10px}#edit-term-translations .pll-language-column,#edit-term-translations .pll-edit-column{width:20px}.term-translations .pll-language-column,.term-translations .pll-edit-column,.term-translations .pll-translation-column{display:table-cell}.term-translations .hidden{display:none}#wpadminbar li#wp-admin-bar-languages{display:block}#wpadminbar #wp-admin-bar-languages>.ab-item{width:50px;text-align:center}#wpadminbar #wp-admin-bar-languages>.ab-item .ab-icon:before{font:32px/1 'dashicons';top:-1px}#wpadminbar #wp-admin-bar-languages>.ab-item img{margin:19px 0}#wpadminbar #wp-admin-bar-languages #wp-admin-bar-all .ab-item .ab-icon{margin-right:6px;font-size:20px !important;line-height:20px !important}}
frontend/frontend-links.php CHANGED
@@ -230,16 +230,24 @@ class PLL_Frontend_Links extends PLL_Links {
230
  * @since 0.1
231
  */
232
  public function wp_head() {
233
- // google recommends to include self link https://support.google.com/webmasters/answer/189077?hl=en
234
  foreach ($this->model->get_languages_list() as $language) {
235
  if ($url = $this->get_translation_url($language))
236
  $urls[$language->slug] = $url;
237
  }
238
 
239
  // ouptputs the section only if there are translations ($urls always contains self link)
240
- if (!empty($urls) && count($urls) > 1) {
241
- foreach ($urls as $lang => $url)
 
242
  printf('<link rel="alternate" href="%s" hreflang="%s" />'."\n", esc_url($url), esc_attr($lang));
 
 
 
 
 
 
 
243
  }
244
  }
245
 
230
  * @since 0.1
231
  */
232
  public function wp_head() {
233
+ // Google recommends to include self link https://support.google.com/webmasters/answer/189077?hl=en
234
  foreach ($this->model->get_languages_list() as $language) {
235
  if ($url = $this->get_translation_url($language))
236
  $urls[$language->slug] = $url;
237
  }
238
 
239
  // ouptputs the section only if there are translations ($urls always contains self link)
240
+ // don't output anything on paged archives: see https://wordpress.org/support/topic/hreflang-on-page2
241
+ if (!empty($urls) && count($urls) > 1 && !is_paged()) {
242
+ foreach ($urls as $lang => $url) {
243
  printf('<link rel="alternate" href="%s" hreflang="%s" />'."\n", esc_url($url), esc_attr($lang));
244
+ }
245
+
246
+ // adds the site root url when the default language code is not hidden
247
+ // see https://wordpress.org/support/topic/implementation-of-hreflangx-default
248
+ if ( is_front_page() && ! $this->options['hide_default'] ) {
249
+ printf( '<link rel="alternate" href="%s" hreflang="x-default" />'."\n", home_url() );
250
+ }
251
  }
252
  }
253
 
frontend/frontend-nav-menu.php CHANGED
@@ -19,7 +19,7 @@ class PLL_Frontend_Nav_Menu extends PLL_Nav_Menu {
19
  $this->curlang = &$polylang->curlang;
20
 
21
  // split the language switcher menu item in several language menu items
22
- add_filter('wp_get_nav_menu_items', array(&$this, 'wp_get_nav_menu_items'));
23
  add_filter('wp_nav_menu_objects', array(&$this, 'wp_nav_menu_objects'));
24
  add_filter('nav_menu_link_attributes', array(&$this, 'nav_menu_link_attributes'), 10, 3);
25
 
@@ -27,6 +27,19 @@ class PLL_Frontend_Nav_Menu extends PLL_Nav_Menu {
27
  add_filter('theme_mod_nav_menu_locations', array($this, 'nav_menu_locations'), 20);
28
  }
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  /*
31
  * splits the one item of backend in several items on frontend
32
  * take care to menu_order as it is used later in wp_nav_menu
@@ -37,6 +50,13 @@ class PLL_Frontend_Nav_Menu extends PLL_Nav_Menu {
37
  * @return array modified items
38
  */
39
  public function wp_get_nav_menu_items($items) {
 
 
 
 
 
 
 
40
  $new_items = array();
41
  $offset = 0;
42
 
19
  $this->curlang = &$polylang->curlang;
20
 
21
  // split the language switcher menu item in several language menu items
22
+ add_filter('wp_get_nav_menu_items', array(&$this, 'wp_get_nav_menu_items'), 20); // after the customizer menus
23
  add_filter('wp_nav_menu_objects', array(&$this, 'wp_nav_menu_objects'));
24
  add_filter('nav_menu_link_attributes', array(&$this, 'nav_menu_link_attributes'), 10, 3);
25
 
27
  add_filter('theme_mod_nav_menu_locations', array($this, 'nav_menu_locations'), 20);
28
  }
29
 
30
+ /*
31
+ * Sort menu items by menu order
32
+ *
33
+ * @since 1.7.9
34
+ *
35
+ * @param object $a The first object to compare
36
+ * @param object $b The second object to compare
37
+ * @return int -1 or 1 if $a is considered to be respectively less than or greater than $b.
38
+ */
39
+ protected function usort_menu_items($a, $b) {
40
+ return ($a->menu_order < $b->menu_order) ? -1 : 1;
41
+ }
42
+
43
  /*
44
  * splits the one item of backend in several items on frontend
45
  * take care to menu_order as it is used later in wp_nav_menu
50
  * @return array modified items
51
  */
52
  public function wp_get_nav_menu_items($items) {
53
+ if (doing_action('customize_register')) { // needed since WP 4.3, doing_action available since WP 3.9
54
+ return $items;
55
+ }
56
+
57
+ // the customizer menus does not sort the items and we need them to be sorted before splitting the language switcher
58
+ usort($items, array($this, 'usort_menu_items'));
59
+
60
  $new_items = array();
61
  $offset = 0;
62
 
include/links-directory.php CHANGED
@@ -136,7 +136,7 @@ class PLL_Links_Directory extends PLL_Links_Permalinks {
136
  // don't modify the rules if there is no languages created yet
137
  if ($this->model->get_languages_list() && !$done) {
138
  // suppress the rules created by WordPress for our taxonomy
139
- add_filter('language_rewrite_rules', create_function('$rules', 'return array();'));
140
 
141
  foreach ($this->get_rewrite_rules_filters() as $type)
142
  add_filter($type . '_rewrite_rules', array(&$this, 'rewrite_rules'));
136
  // don't modify the rules if there is no languages created yet
137
  if ($this->model->get_languages_list() && !$done) {
138
  // suppress the rules created by WordPress for our taxonomy
139
+ add_filter('language_rewrite_rules', '__return_empty_array');
140
 
141
  foreach ($this->get_rewrite_rules_filters() as $type)
142
  add_filter($type . '_rewrite_rules', array(&$this, 'rewrite_rules'));
include/model.php CHANGED
@@ -46,7 +46,7 @@ class PLL_Model {
46
  add_action('registered_post_type', array(&$this, 'registered_post_type'));
47
 
48
  // just in case someone would like to display the language description ;-)
49
- add_filter('language_description', create_function('$v', "return '';"));
50
  }
51
 
52
  /*
46
  add_action('registered_post_type', array(&$this, 'registered_post_type'));
47
 
48
  // just in case someone would like to display the language description ;-)
49
+ add_filter('language_description', '__return_empty_string');
50
  }
51
 
52
  /*
include/plugins-compat.php CHANGED
@@ -54,7 +54,7 @@ class PLL_Plugins_Compat {
54
 
55
  return self::$instance;
56
  }
57
-
58
  /*
59
  * WordPress Importer
60
  * if WordPress Importer is active, replace the wordpress_importer_init function
@@ -113,9 +113,12 @@ class PLL_Plugins_Compat {
113
  // one sitemap per language when using multiple domains or subdomains
114
  // because WPSEO does not accept several domains or subdomains in one sitemap
115
  if ($polylang->options['force_lang'] > 1) {
 
116
  add_filter('home_url', array(&$this, 'wpseo_home_url'), 10, 2); // fix home_url
117
  add_filter('wpseo_posts_join', array(&$this, 'wpseo_posts_join'), 10, 2);
118
  add_filter('wpseo_posts_where', array(&$this, 'wpseo_posts_where'), 10, 2);
 
 
119
  }
120
 
121
  // one sitemap for all languages when the language is set from the content or directory name
54
 
55
  return self::$instance;
56
  }
57
+
58
  /*
59
  * WordPress Importer
60
  * if WordPress Importer is active, replace the wordpress_importer_init function
113
  // one sitemap per language when using multiple domains or subdomains
114
  // because WPSEO does not accept several domains or subdomains in one sitemap
115
  if ($polylang->options['force_lang'] > 1) {
116
+ add_filter('wpseo_enable_xml_sitemap_transient_caching', '__return_false'); // disable cache! otherwise WPSEO keeps only one domain
117
  add_filter('home_url', array(&$this, 'wpseo_home_url'), 10, 2); // fix home_url
118
  add_filter('wpseo_posts_join', array(&$this, 'wpseo_posts_join'), 10, 2);
119
  add_filter('wpseo_posts_where', array(&$this, 'wpseo_posts_where'), 10, 2);
120
+ add_filter('wpseo_typecount_join', array(&$this, 'wpseo_posts_join'), 10, 2);
121
+ add_filter('wpseo_typecount_where', array(&$this, 'wpseo_posts_where'), 10, 2);
122
  }
123
 
124
  // one sitemap for all languages when the language is set from the content or directory name
include/widget-languages.php CHANGED
@@ -127,9 +127,12 @@ class PLL_Widget_Languages extends WP_Widget {
127
  });
128
 
129
  // disallow unchecking both show names and show flags
130
- $('#widget-'+this_id+'-show_flags').change(function() {
131
- if ('checked' != $(this).attr('checked'))
132
- $('#widget-'+this_id+'-show_names').prop('checked', true);
 
 
 
133
  });
134
 
135
  });
127
  });
128
 
129
  // disallow unchecking both show names and show flags
130
+ var options = ['-show_flags', '-show_names'];
131
+ $.each(options, function(i, v) {
132
+ $('#widget-'+this_id+v).change(function() {
133
+ if ('checked' != $(this).attr('checked'))
134
+ $('#widget-'+this_id+options[1-i]).prop('checked', true);
135
+ });
136
  });
137
 
138
  });
js/nav-menu.js CHANGED
@@ -3,15 +3,16 @@ jQuery(document).ready(function($) {
3
  if ( e.target && e.target.className && -1 != e.target.className.indexOf('item-edit')) {
4
  $("input[value='#pll_switcher'][type=text]").parent().parent().parent().each( function(){
5
  var item = $(this).attr('id').substring(19);
6
- // remove default fields we don't need
7
- $(this).children('.description-thin,.field-link-target,.field-description,.field-url').remove();
8
  h = $('<input>').attr({
9
  type: 'hidden',
10
  id: 'edit-menu-item-title-'+item,
11
  name: 'menu-item-title['+item+']',
12
- value: pll_data.strings[4]
13
  });
14
  $(this).append(h);
 
15
  h = $('<input>').attr({
16
  type: 'hidden',
17
  id: 'edit-menu-item-url-'+item,
@@ -19,6 +20,7 @@ jQuery(document).ready(function($) {
19
  value: '#pll_switcher'
20
  });
21
  $(this).append(h);
 
22
  // a hidden field which exits only if our jQuery code has been executed
23
  h = $('<input>').attr({
24
  type: 'hidden',
@@ -51,9 +53,12 @@ jQuery(document).ready(function($) {
51
  // disallow unchecking both show names and show flags
52
  $('.menu-item-data-object-id').each(function() {
53
  var id = $(this).val();
54
- $('#edit-menu-item-show_flags-'+id).change(function() {
55
- if ('checked' != $(this).attr('checked'))
56
- $('#edit-menu-item-show_names-'+id).prop('checked', true);
 
 
 
57
  });
58
  });
59
 
3
  if ( e.target && e.target.className && -1 != e.target.className.indexOf('item-edit')) {
4
  $("input[value='#pll_switcher'][type=text]").parent().parent().parent().each( function(){
5
  var item = $(this).attr('id').substring(19);
6
+ $(this).children('p:not(.field-move)').remove(); // remove default fields we don't need
7
+
8
  h = $('<input>').attr({
9
  type: 'hidden',
10
  id: 'edit-menu-item-title-'+item,
11
  name: 'menu-item-title['+item+']',
12
+ value: pll_data.title
13
  });
14
  $(this).append(h);
15
+
16
  h = $('<input>').attr({
17
  type: 'hidden',
18
  id: 'edit-menu-item-url-'+item,
20
  value: '#pll_switcher'
21
  });
22
  $(this).append(h);
23
+
24
  // a hidden field which exits only if our jQuery code has been executed
25
  h = $('<input>').attr({
26
  type: 'hidden',
53
  // disallow unchecking both show names and show flags
54
  $('.menu-item-data-object-id').each(function() {
55
  var id = $(this).val();
56
+ var options = ['names-', 'flags-'];
57
+ $.each(options, function(i, v) {
58
+ $('#edit-menu-item-show_'+v+id).change(function() {
59
+ if ('checked' != $(this).attr('checked'))
60
+ $('#edit-menu-item-show_'+options[1-i]+id).prop('checked', true);
61
+ });
62
  });
63
  });
64
 
js/nav-menu.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){a("#update-nav-menu").bind("click",function(b){if(b.target&&b.target.className&&-1!=b.target.className.indexOf("item-edit")){a("input[value='#pll_switcher'][type=text]").parent().parent().parent().each(function(){var d=a(this).attr("id").substring(19);a(this).children(".description-thin,.field-link-target,.field-description,.field-url").remove();h=a("<input>").attr({type:"hidden",id:"edit-menu-item-title-"+d,name:"menu-item-title["+d+"]",value:pll_data.strings[4]});a(this).append(h);h=a("<input>").attr({type:"hidden",id:"edit-menu-item-url-"+d,name:"menu-item-url["+d+"]",value:"#pll_switcher"});a(this).append(h);h=a("<input>").attr({type:"hidden",id:"edit-menu-item-pll-detect-"+d,name:"menu-item-pll-detect["+d+"]",value:1});a(this).append(h);ids=Array("hide_if_no_translation","hide_current","force_home","show_flags","show_names");for(var c=0;c<ids.length;c++){p=a("<p>").attr("class","description");a(this).prepend(p);label=a("<label>").attr("for","menu-item-"+ids[c]+"-"+d).text(" "+pll_data.strings[c]);p.append(label);cb=a("<input>").attr({type:"checkbox",id:"edit-menu-item-"+ids[c]+"-"+d,name:"menu-item-"+ids[c]+"["+d+"]",value:1});if((typeof(pll_data.val[d])!="undefined"&&pll_data.val[d][ids[c]]==1)||(typeof(pll_data.val[d])=="undefined"&&ids[c]=="show_names")){cb.prop("checked",true)}label.prepend(cb)}});a(".menu-item-data-object-id").each(function(){var c=a(this).val();a("#edit-menu-item-show_flags-"+c).change(function(){if("checked"!=a(this).attr("checked")){a("#edit-menu-item-show_names-"+c).prop("checked",true)}})})}})});
1
+ jQuery(document).ready(function(a){a("#update-nav-menu").bind("click",function(b){if(b.target&&b.target.className&&-1!=b.target.className.indexOf("item-edit")){a("input[value='#pll_switcher'][type=text]").parent().parent().parent().each(function(){var d=a(this).attr("id").substring(19);a(this).children("p:not(.field-move)").remove();h=a("<input>").attr({type:"hidden",id:"edit-menu-item-title-"+d,name:"menu-item-title["+d+"]",value:pll_data.title});a(this).append(h);h=a("<input>").attr({type:"hidden",id:"edit-menu-item-url-"+d,name:"menu-item-url["+d+"]",value:"#pll_switcher"});a(this).append(h);h=a("<input>").attr({type:"hidden",id:"edit-menu-item-pll-detect-"+d,name:"menu-item-pll-detect["+d+"]",value:1});a(this).append(h);ids=Array("hide_if_no_translation","hide_current","force_home","show_flags","show_names");for(var c=0;c<ids.length;c++){p=a("<p>").attr("class","description");a(this).prepend(p);label=a("<label>").attr("for","menu-item-"+ids[c]+"-"+d).text(" "+pll_data.strings[c]);p.append(label);cb=a("<input>").attr({type:"checkbox",id:"edit-menu-item-"+ids[c]+"-"+d,name:"menu-item-"+ids[c]+"["+d+"]",value:1});if((typeof(pll_data.val[d])!="undefined"&&pll_data.val[d][ids[c]]==1)||(typeof(pll_data.val[d])=="undefined"&&ids[c]=="show_names")){cb.prop("checked",true)}label.prepend(cb)}});a(".menu-item-data-object-id").each(function(){var d=a(this).val();var c=["names-","flags-"];a.each(c,function(f,e){a("#edit-menu-item-show_"+e+d).change(function(){if("checked"!=a(this).attr("checked")){a("#edit-menu-item-show_"+c[1-f]+d).prop("checked",true)}})})})}})});
polylang.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Polylang
4
  Plugin URI: http://polylang.wordpress.com/
5
- Version: 1.7.8
6
  Author: Frédéric Demarle
7
  Author uri: http://polylang.wordpress.com
8
  Description: Adds multilingual capability to WordPress
@@ -34,8 +34,8 @@ Domain Path: /languages
34
  if (!function_exists('add_action'))
35
  exit();
36
 
37
- define('POLYLANG_VERSION', '1.7.8');
38
- define('PLL_MIN_WP_VERSION', '3.8');
39
 
40
  define('POLYLANG_BASENAME', plugin_basename(__FILE__)); // plugin name as known by WP
41
 
2
  /*
3
  Plugin Name: Polylang
4
  Plugin URI: http://polylang.wordpress.com/
5
+ Version: 1.7.9
6
  Author: Frédéric Demarle
7
  Author uri: http://polylang.wordpress.com
8
  Description: Adds multilingual capability to WordPress
34
  if (!function_exists('add_action'))
35
  exit();
36
 
37
+ define('POLYLANG_VERSION', '1.7.9');
38
+ define('PLL_MIN_WP_VERSION', '3.9');
39
 
40
  define('POLYLANG_BASENAME', plugin_basename(__FILE__)); // plugin name as known by WP
41
 
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: Chouby
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CCWWYUUQV8F4E
4
  Tags: multilingual, bilingual, translate, translation, language, multilanguage, international, localization
5
- Requires at least: 3.8
6
- Tested up to: 4.2
7
- Stable tag: 1.7.8
8
  License: GPLv2 or later
9
 
10
  Making WordPress multilingual
@@ -111,6 +111,16 @@ See http://polylang.wordpress.com/documentation/contribute/
111
 
112
  == Changelog ==
113
 
 
 
 
 
 
 
 
 
 
 
114
  = 1.7.8 (2015-07-21) =
115
 
116
  * fix: conflict with PHP < 5.4 introduced in 1.7.7
2
  Contributors: Chouby
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CCWWYUUQV8F4E
4
  Tags: multilingual, bilingual, translate, translation, language, multilanguage, international, localization
5
+ Requires at least: 3.9
6
+ Tested up to: 4.3
7
+ Stable tag: 1.7.9
8
  License: GPLv2 or later
9
 
10
  Making WordPress multilingual
111
 
112
  == Changelog ==
113
 
114
+ = 1.7.9 (2015-08-17) =
115
+
116
+ * Minimum WordPress version is now v3.9
117
+ * Add: hreflang="x-default" on front page when the default language code is not hidden in urls
118
+ * fix: remove hreflang links in html head section of paged archives to please Google
119
+ * fix: conflict with WPSEO sitemap caching when using multiple domains. [props Junaid Bhura](https://wordpress.org/support/topic/wp-seo-sitemap-and-translation-subdomain-issue?replies=8#post-7113817)
120
+ * fix: change the order of strings translations columns for better display on mobile devices in WP 4.3
121
+ * fix: various issues with nav menus and customizer in WP 4.3
122
+ * fix: correctly disallow unchecking both show names and show flags in the language switcher form
123
+
124
  = 1.7.8 (2015-07-21) =
125
 
126
  * fix: conflict with PHP < 5.4 introduced in 1.7.7