Polylang - Version 0.3.1

Version Description

  • Bug correction: the widget settings cannot be saved when activating Polylang
  • Bug correction: the archives widget does not display any links
  • Bug correction: ajax form for translations not working in the 'Categories' and 'Post tags' admin panels

release: October 16th, 2011

Download this release

Release Info

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

Code changes from version 0.3 to 0.3.1

Files changed (4) hide show
  1. admin.php +1 -0
  2. polylang.php +10 -10
  3. readme.txt +9 -1
  4. term-translations.php +1 -2
admin.php CHANGED
@@ -587,6 +587,7 @@ class Polylang_Admin extends Polylang_Base {
587
  $widget_lang[$widget->id] = $_POST[$id];
588
  update_option('polylang_widgets', $widget_lang);
589
  }
 
590
  }
591
 
592
  // refresh rewrite rules if the 'page_on_front' option is modified
587
  $widget_lang[$widget->id] = $_POST[$id];
588
  update_option('polylang_widgets', $widget_lang);
589
  }
590
+ return $instance;
591
  }
592
 
593
  // refresh rewrite rules if the 'page_on_front' option is modified
polylang.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Polylang
4
  Plugin URI: http://wordpress.org/extend/plugins/polylang/
5
- Version: 0.3
6
  Author: F. Demarle
7
  Description: Adds multilingual capability to Wordpress
8
  */
@@ -400,6 +400,7 @@ class Polylang extends Polylang_Base {
400
  $post_id = get_option('page_on_front');
401
  if (isset($this->curlang) && $post_id) {
402
  // a static page is used as front page
 
403
  $language = $this->get_post_language($post_id);
404
  if ($language->slug != $this->curlang->slug) {
405
  // but the one defined in the "Reading Settings" panel is not in the right language, so let's redirect to the right one
@@ -580,10 +581,10 @@ class Polylang extends Polylang_Base {
580
  $home = home_url();
581
  if ($wp_rewrite->using_permalinks()) {
582
  $options['rewrite'] ? $base = '/' : $base = '/language/';
583
- $link_html = esc_url(str_replace($home, $home.$base.$this->curlang->slug, $link_html));
584
  }
585
  else
586
- $link_html = esc_url(str_replace($home.'/?', $home.'/?lang='.$this->curlang->slug.'&', $link_html));
587
  }
588
  return $link_html;
589
  }
@@ -645,13 +646,12 @@ class Polylang extends Polylang_Base {
645
 
646
  // filters the widgets according to the current language
647
  function widget_display_callback($instance, $widget, $args) {
648
- if (isset($this->curlang)) {
649
- $widget_lang = get_option('polylang_widgets');
650
- // don't display if a language filter is set and this is not the current one
651
- if (isset($widget_lang[$widget->id]) && $widget_lang[$widget->id] && $widget_lang[$widget->id] != $this->curlang->slug)
652
- return false;
653
- }
654
- return true;
655
  }
656
 
657
  // returns the home url in the right language
2
  /*
3
  Plugin Name: Polylang
4
  Plugin URI: http://wordpress.org/extend/plugins/polylang/
5
+ Version: 0.3.1
6
  Author: F. Demarle
7
  Description: Adds multilingual capability to Wordpress
8
  */
400
  $post_id = get_option('page_on_front');
401
  if (isset($this->curlang) && $post_id) {
402
  // a static page is used as front page
403
+
404
  $language = $this->get_post_language($post_id);
405
  if ($language->slug != $this->curlang->slug) {
406
  // but the one defined in the "Reading Settings" panel is not in the right language, so let's redirect to the right one
581
  $home = home_url();
582
  if ($wp_rewrite->using_permalinks()) {
583
  $options['rewrite'] ? $base = '/' : $base = '/language/';
584
+ $link_html = str_replace($home, esc_attr($home.$base.$this->curlang->slug), $link_html);
585
  }
586
  else
587
+ $link_html = str_replace($home.'/?', esc_attr($home.'/?lang='.$this->curlang->slug).'&', $link_html);
588
  }
589
  return $link_html;
590
  }
646
 
647
  // filters the widgets according to the current language
648
  function widget_display_callback($instance, $widget, $args) {
649
+ $widget_lang = get_option('polylang_widgets');
650
+ // don't display if a language filter is set and this is not the current one
651
+ if (isset($this->curlang) && isset($widget_lang[$widget->id]) && $widget_lang[$widget->id] && $widget_lang[$widget->id] != $this->curlang->slug)
652
+ return false;
653
+
654
+ return $instance;
 
655
  }
656
 
657
  // returns the home url in the right language
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Chouby
3
  Tags: bilingual, multilingual, language, i18n, l10n, international, translate, translation, widget
4
  Requires at least: 3.1
5
  Tested up to: 3.2.1
6
- Stable tag: 0.3
7
 
8
  Adds multilingual support to WordPress.
9
 
@@ -89,6 +89,14 @@ You MUST define a language for all your categories and post tags otherwise they
89
 
90
  == Changelog ==
91
 
 
 
 
 
 
 
 
 
92
  = 0.3 =
93
 
94
  * Add language filter for widgets
3
  Tags: bilingual, multilingual, language, i18n, l10n, international, translate, translation, widget
4
  Requires at least: 3.1
5
  Tested up to: 3.2.1
6
+ Stable tag: 0.3.1
7
 
8
  Adds multilingual support to WordPress.
9
 
89
 
90
  == Changelog ==
91
 
92
+ = 0.3.1 =
93
+
94
+ * Bug correction: the widget settings cannot be saved when activating Polylang
95
+ * Bug correction: the archives widget does not display any links
96
+ * Bug correction: ajax form for translations not working in the 'Categories' and 'Post tags' admin panels
97
+
98
+ release: October 16th, 2011
99
+
100
  = 0.3 =
101
 
102
  * Add language filter for widgets
term-translations.php CHANGED
@@ -74,8 +74,7 @@ else { // add term form?>
74
  $taxonomy,
75
  $translation->term_id
76
  )));
77
- echo '<a href="' . $link . '">' . __('Edit','polylang') . '</a>';
78
- };?>
79
  </td><?php
80
  } ?>
81
  </tr><?php
74
  $taxonomy,
75
  $translation->term_id
76
  )));
77
+ echo '<a href="' . $link . '">' . __('Edit','polylang') . '</a>';?>
 
78
  </td><?php
79
  } ?>
80
  </tr><?php