Polylang - Version 2.0.7

Version Description

(2016-10-18) =

  • Fix issues with static front pages introduced in version 2.0.6
Download this release

Release Info

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

Code changes from version 2.0.6 to 2.0.7

changelog.txt CHANGED
@@ -2,6 +2,45 @@
2
 
3
  This file contains only old changelog. See readme.txt for newer versions.
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  = 1.8.5 (2016-04-03) =
6
 
7
  * Revert from $_SERVER['PHP_SELF'] to $_SERVER['SCRIPT_FILENAME'] to detect if the user is on login/register/signup page
2
 
3
  This file contains only old changelog. See readme.txt for newer versions.
4
 
5
+ = 1.9.3 (2016-06-28) =
6
+
7
+ * Pro: Allow to add slashes in url slugs translations
8
+ * Pro: Fix archive links not using translated slugs
9
+ * Pro: Fix visitor being redirected to 404 if his browser preference is set to an inactive language
10
+ * Fix strings translations table always back to page 1 when submitting the form (#14)
11
+ * Fix get_pages( array( 'lang' => '' ) ) not querying all the languages
12
+ * Fix switching the admin language filter can override the static front page settings (#16)
13
+
14
+ = 1.9.2 (2016-06-06) =
15
+
16
+ * Pro: fix unreachable hierarchical custom post type posts when they are sharing slugs across languages
17
+ * Fix missing argument 3 in icl_t
18
+ * Fix conflict with WooCommerce product variations
19
+
20
+ = 1.9.1 (2016-05-23) =
21
+
22
+ * Pro: add compatibility with Beaver Builder
23
+ * Pro: fix media wrongly created when adding a new media translation
24
+ * Add azb, ceb, de_CH_informal, es_GT, mr, nl_NL_formal to the predefined list of languages
25
+ * Fix the language switcher not linking to media translations for anonymous visitors
26
+
27
+ = 1.9 (2016-04-27) =
28
+
29
+ * Pro: add the possibility to translate custom post types slugs, taxonomies slugs and more
30
+ * Pro: add the possibility to share the same post or term slug accross languages
31
+ * Pro: add the possibility to duplicate the content when creating a new translation
32
+ * Pro: add the possibility to create all translations at once when uploading a media
33
+ * Pro: add the possibility to disable a language
34
+ * Add license and update management
35
+ * Add inline docs for all filters and actions
36
+ * When possible, the rel alternate hreflang now display only the language code (without the country code)
37
+ * When combined with flags in the language switcher, wrap the language name inside <span> tags
38
+ * Add customizer selective refresh support for the language switcher widget ( needs WP 4.5+ )
39
+ * Fix dynamic options of the language switcher widget not working in the customizer
40
+ * Fix possible error 404 on page shortlink when using subdomains or multiple domains
41
+ * Fix get_adjacent_post() and wp_get_archives() for untranslated post types ( needs WP 4.4+ )
42
+ * Fix language homepage urls not present in Yoast SEO sitemap (when the homepages display posts)
43
+
44
  = 1.8.5 (2016-04-03) =
45
 
46
  * Revert from $_SERVER['PHP_SELF'] to $_SERVER['SCRIPT_FILENAME'] to detect if the user is on login/register/signup page
include/class-polylang.php CHANGED
@@ -151,6 +151,9 @@ class Polylang {
151
  }
152
  }
153
 
 
 
 
154
  /**
155
  * Filter the model class to use
156
  * /!\ this filter is fired *before* the $polylang object is available
@@ -163,8 +166,6 @@ class Polylang {
163
  $model = new $class( $options );
164
  $links_model = $model->get_links_model();
165
 
166
- add_filter( 'pll_languages_list', array( 'PLL_Static_Pages', 'pll_languages_list' ), 2, 2 ); // before PLL_Links_Model
167
-
168
  if ( PLL_SETTINGS ) {
169
  $polylang = new PLL_Settings( $links_model );
170
  }
151
  }
152
  }
153
 
154
+ // Make sure that this filter is *always* added before PLL_Model::get_languages_list() is called for the first time
155
+ add_filter( 'pll_languages_list', array( 'PLL_Static_Pages', 'pll_languages_list' ), 2, 2 ); // before PLL_Links_Model
156
+
157
  /**
158
  * Filter the model class to use
159
  * /!\ this filter is fired *before* the $polylang object is available
166
  $model = new $class( $options );
167
  $links_model = $model->get_links_model();
168
 
 
 
169
  if ( PLL_SETTINGS ) {
170
  $polylang = new PLL_Settings( $links_model );
171
  }
include/links-directory.php CHANGED
@@ -19,14 +19,10 @@ class PLL_Links_Directory extends PLL_Links_Permalinks {
19
  public function __construct( &$model ) {
20
  parent::__construct( $model );
21
 
22
- // Don't modify rewrite rules if no language is created yet
23
- // Especially don't call add_permastruct which removes the /language/ rewrite base and lead to 404 for pages
24
- if ( $model->get_languages_list() ) {
25
- if ( did_action( 'pll_init' ) ) {
26
- $this->init();
27
- } else {
28
- add_action( 'pll_init', array( $this, 'init' ) );
29
- }
30
  }
31
  }
32
 
@@ -132,7 +128,10 @@ class PLL_Links_Directory extends PLL_Links_Permalinks {
132
  function add_permastruct() {
133
  // Language information always in front of the uri ( 'with_front' => false )
134
  // The 3rd parameter structure has been modified in WP 3.4
135
- add_permastruct( 'language', $this->options['rewrite'] ? '%language%' : 'language/%language%', array( 'with_front' => false ) );
 
 
 
136
  }
137
 
138
  /**
19
  public function __construct( &$model ) {
20
  parent::__construct( $model );
21
 
22
+ if ( did_action( 'pll_init' ) ) {
23
+ $this->init();
24
+ } else {
25
+ add_action( 'pll_init', array( $this, 'init' ) );
 
 
 
 
26
  }
27
  }
28
 
128
  function add_permastruct() {
129
  // Language information always in front of the uri ( 'with_front' => false )
130
  // The 3rd parameter structure has been modified in WP 3.4
131
+ // Leads to error 404 for pages when there is no language created yet
132
+ if ( $this->model->get_languages_list() ) {
133
+ add_permastruct( 'language', $this->options['rewrite'] ? '%language%' : 'language/%language%', array( 'with_front' => false ) );
134
+ }
135
  }
136
 
137
  /**
polylang.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Polylang
5
  Plugin URI: https://polylang.pro
6
- Version: 2.0.6
7
  Author: Frédéric Demarle
8
  Author uri: https://polylang.pro
9
  Description: Adds multilingual capability to WordPress
@@ -35,7 +35,7 @@ if ( ! defined( 'ABSPATH' ) ) {
35
  exit; // don't access directly
36
  };
37
 
38
- define( 'POLYLANG_VERSION', '2.0.6' );
39
  define( 'PLL_MIN_WP_VERSION', '4.0' );
40
 
41
  define( 'POLYLANG_FILE', __FILE__ ); // this file
3
  /*
4
  Plugin Name: Polylang
5
  Plugin URI: https://polylang.pro
6
+ Version: 2.0.7
7
  Author: Frédéric Demarle
8
  Author uri: https://polylang.pro
9
  Description: Adds multilingual capability to WordPress
35
  exit; // don't access directly
36
  };
37
 
38
+ define( 'POLYLANG_VERSION', '2.0.7' );
39
  define( 'PLL_MIN_WP_VERSION', '4.0' );
40
 
41
  define( 'POLYLANG_FILE', __FILE__ ); // this file
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://polylang.pro
4
  Tags: multilingual, bilingual, translate, translation, language, multilanguage, international, localization
5
  Requires at least: 4.0
6
  Tested up to: 4.6
7
- Stable tag: 2.0.6
8
  License: GPLv2 or later
9
 
10
  Making WordPress multilingual
@@ -77,6 +77,10 @@ Don't hesitate to [give your feedback](http://wordpress.org/support/view/plugin-
77
 
78
  == Changelog ==
79
 
 
 
 
 
80
  = 2.0.6 (2016-10-17) =
81
 
82
  * Pro: Fix translated paged slug not working on paged static front page
@@ -157,43 +161,4 @@ Don't hesitate to [give your feedback](http://wordpress.org/support/view/plugin-
157
  * Fix conflict (database error) with ReOrder-posts-within-categories plugin
158
  * Fix languages per page option not saved
159
 
160
- = 1.9.3 (2016-06-28) =
161
-
162
- * Pro: Allow to add slashes in url slugs translations
163
- * Pro: Fix archive links not using translated slugs
164
- * Pro: Fix visitor being redirected to 404 if his browser preference is set to an inactive language
165
- * Fix strings translations table always back to page 1 when submitting the form (#14)
166
- * Fix get_pages( array( 'lang' => '' ) ) not querying all the languages
167
- * Fix switching the admin language filter can override the static front page settings (#16)
168
-
169
- = 1.9.2 (2016-06-06) =
170
-
171
- * Pro: fix unreachable hierarchical custom post type posts when they are sharing slugs across languages
172
- * Fix missing argument 3 in icl_t
173
- * Fix conflict with WooCommerce product variations
174
-
175
- = 1.9.1 (2016-05-23) =
176
-
177
- * Pro: add compatibility with Beaver Builder
178
- * Pro: fix media wrongly created when adding a new media translation
179
- * Add azb, ceb, de_CH_informal, es_GT, mr, nl_NL_formal to the predefined list of languages
180
- * Fix the language switcher not linking to media translations for anonymous visitors
181
-
182
- = 1.9 (2016-04-27) =
183
-
184
- * Pro: add the possibility to translate custom post types slugs, taxonomies slugs and more
185
- * Pro: add the possibility to share the same post or term slug accross languages
186
- * Pro: add the possibility to duplicate the content when creating a new translation
187
- * Pro: add the possibility to create all translations at once when uploading a media
188
- * Pro: add the possibility to disable a language
189
- * Add license and update management
190
- * Add inline docs for all filters and actions
191
- * When possible, the rel alternate hreflang now display only the language code (without the country code)
192
- * When combined with flags in the language switcher, wrap the language name inside <span> tags
193
- * Add customizer selective refresh support for the language switcher widget ( needs WP 4.5+ )
194
- * Fix dynamic options of the language switcher widget not working in the customizer
195
- * Fix possible error 404 on page shortlink when using subdomains or multiple domains
196
- * Fix get_adjacent_post() and wp_get_archives() for untranslated post types ( needs WP 4.4+ )
197
- * Fix language homepage urls not present in Yoast SEO sitemap (when the homepages display posts)
198
-
199
  See [changelog.txt](https://plugins.svn.wordpress.org/polylang/trunk/changelog.txt) for older changelog
4
  Tags: multilingual, bilingual, translate, translation, language, multilanguage, international, localization
5
  Requires at least: 4.0
6
  Tested up to: 4.6
7
+ Stable tag: 2.0.7
8
  License: GPLv2 or later
9
 
10
  Making WordPress multilingual
77
 
78
  == Changelog ==
79
 
80
+ = 2.0.7 (2016-10-18) =
81
+
82
+ * Fix issues with static front pages introduced in version 2.0.6
83
+
84
  = 2.0.6 (2016-10-17) =
85
 
86
  * Pro: Fix translated paged slug not working on paged static front page
161
  * Fix conflict (database error) with ReOrder-posts-within-categories plugin
162
  * Fix languages per page option not saved
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  See [changelog.txt](https://plugins.svn.wordpress.org/polylang/trunk/changelog.txt) for older changelog