Version Description
(2020-02-19) =
- Pro: Fix sticky posts not filtered in REST API (introduced in 2.6.9)
- Fix wrong language detected if a child page uses the slug of another language
- Fix a PHP notice with PHP 7.4. #438
- Fix lang-item-first class in language switcher when the current language is hidden. #445
- Fix partially a conflict with Fusion Builder (the other part of the conflict being in Fusion Builder).
Download this release
Release Info
Developer | Chouby |
Plugin | Polylang |
Version | 2.6.10 |
Comparing to | |
See all releases |
Code changes from version 2.6.9 to 2.6.10
- admin/admin.php +1 -1
- include/links-directory.php +1 -1
- include/switcher.php +6 -7
- polylang.php +2 -2
- readme.txt +9 -1
- settings/settings-browser.php +1 -0
admin/admin.php
CHANGED
@@ -60,7 +60,7 @@ class PLL_Admin extends PLL_Admin_Base {
|
|
60 |
// Priority 5 to make sure filters are there before customize_register is fired
|
61 |
if ( $this->model->get_languages_list() ) {
|
62 |
add_action( 'wp_loaded', array( $this, 'add_filters' ), 5 );
|
63 |
-
add_action( 'admin_init', array( $this, 'maybe_load_sync_post' ) );
|
64 |
|
65 |
// Bulk Translate
|
66 |
if ( class_exists( 'PLL_Bulk_Translate' ) ) {
|
60 |
// Priority 5 to make sure filters are there before customize_register is fired
|
61 |
if ( $this->model->get_languages_list() ) {
|
62 |
add_action( 'wp_loaded', array( $this, 'add_filters' ), 5 );
|
63 |
+
add_action( 'admin_init', array( $this, 'maybe_load_sync_post' ), 20 ); // After fusion Builder.
|
64 |
|
65 |
// Bulk Translate
|
66 |
if ( class_exists( 'PLL_Bulk_Translate' ) ) {
|
include/links-directory.php
CHANGED
@@ -116,7 +116,7 @@ class PLL_Links_Directory extends PLL_Links_Permalinks {
|
|
116 |
|
117 |
$pattern = wp_parse_url( $root . ( $this->options['rewrite'] ? '' : 'language/' ), PHP_URL_PATH );
|
118 |
$pattern = str_replace( '/', '\/', $pattern );
|
119 |
-
$pattern = '
|
120 |
return preg_match( $pattern, trailingslashit( $path ), $matches ) ? $matches[1] : ''; // $matches[1] is the slug of the requested language
|
121 |
}
|
122 |
|
116 |
|
117 |
$pattern = wp_parse_url( $root . ( $this->options['rewrite'] ? '' : 'language/' ), PHP_URL_PATH );
|
118 |
$pattern = str_replace( '/', '\/', $pattern );
|
119 |
+
$pattern = '#^' . $pattern . '(' . implode( '|', $this->model->get_languages_list( array( 'fields' => 'slug' ) ) ) . ')(\/|$)#';
|
120 |
return preg_match( $pattern, trailingslashit( $path ), $matches ) ? $matches[1] : ''; // $matches[1] is the slug of the requested language
|
121 |
}
|
122 |
|
include/switcher.php
CHANGED
@@ -53,16 +53,10 @@ class PLL_Switcher {
|
|
53 |
$classes = array( 'lang-item', 'lang-item-' . $id, 'lang-item-' . esc_attr( $slug ) );
|
54 |
$url = null; // Avoids potential notice
|
55 |
|
56 |
-
if ( $first ) {
|
57 |
-
$classes[] = 'lang-item-first';
|
58 |
-
$first = false;
|
59 |
-
}
|
60 |
-
|
61 |
if ( $current_lang = $links->curlang->slug == $slug ) {
|
62 |
if ( $args['hide_current'] && ! ( $args['dropdown'] && ! $args['raw'] ) ) {
|
63 |
continue; // Hide current language except for dropdown
|
64 |
-
}
|
65 |
-
else {
|
66 |
$classes[] = 'current-lang';
|
67 |
}
|
68 |
}
|
@@ -98,6 +92,11 @@ class PLL_Switcher {
|
|
98 |
$name = $args['show_names'] || ! $args['show_flags'] || $args['raw'] ? ( 'slug' == $args['display_names_as'] ? $slug : $language->name ) : '';
|
99 |
$flag = $args['raw'] && ! $args['show_flags'] ? $language->flag_url : ( $args['show_flags'] ? $language->flag : '' );
|
100 |
|
|
|
|
|
|
|
|
|
|
|
101 |
$out[ $slug ] = compact( 'id', 'order', 'slug', 'locale', 'name', 'url', 'flag', 'current_lang', 'no_translation', 'classes' );
|
102 |
}
|
103 |
|
53 |
$classes = array( 'lang-item', 'lang-item-' . $id, 'lang-item-' . esc_attr( $slug ) );
|
54 |
$url = null; // Avoids potential notice
|
55 |
|
|
|
|
|
|
|
|
|
|
|
56 |
if ( $current_lang = $links->curlang->slug == $slug ) {
|
57 |
if ( $args['hide_current'] && ! ( $args['dropdown'] && ! $args['raw'] ) ) {
|
58 |
continue; // Hide current language except for dropdown
|
59 |
+
} else {
|
|
|
60 |
$classes[] = 'current-lang';
|
61 |
}
|
62 |
}
|
92 |
$name = $args['show_names'] || ! $args['show_flags'] || $args['raw'] ? ( 'slug' == $args['display_names_as'] ? $slug : $language->name ) : '';
|
93 |
$flag = $args['raw'] && ! $args['show_flags'] ? $language->flag_url : ( $args['show_flags'] ? $language->flag : '' );
|
94 |
|
95 |
+
if ( $first ) {
|
96 |
+
$classes[] = 'lang-item-first';
|
97 |
+
$first = false;
|
98 |
+
}
|
99 |
+
|
100 |
$out[ $slug ] = compact( 'id', 'order', 'slug', 'locale', 'name', 'url', 'flag', 'current_lang', 'no_translation', 'classes' );
|
101 |
}
|
102 |
|
polylang.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
Plugin Name: Polylang
|
5 |
Plugin URI: https://polylang.pro
|
6 |
-
Version: 2.6.
|
7 |
Author: WP SYNTEX
|
8 |
Author uri: https://polylang.pro
|
9 |
Description: Adds multilingual capability to WordPress
|
@@ -51,7 +51,7 @@ if ( defined( 'POLYLANG_BASENAME' ) ) {
|
|
51 |
}
|
52 |
} else {
|
53 |
// Go on loading the plugin
|
54 |
-
define( 'POLYLANG_VERSION', '2.6.
|
55 |
define( 'PLL_MIN_WP_VERSION', '4.7' );
|
56 |
define( 'PLL_MIN_PHP_VERSION', '5.6' );
|
57 |
|
3 |
/**
|
4 |
Plugin Name: Polylang
|
5 |
Plugin URI: https://polylang.pro
|
6 |
+
Version: 2.6.10
|
7 |
Author: WP SYNTEX
|
8 |
Author uri: https://polylang.pro
|
9 |
Description: Adds multilingual capability to WordPress
|
51 |
}
|
52 |
} else {
|
53 |
// Go on loading the plugin
|
54 |
+
define( 'POLYLANG_VERSION', '2.6.10' );
|
55 |
define( 'PLL_MIN_WP_VERSION', '4.7' );
|
56 |
define( 'PLL_MIN_PHP_VERSION', '5.6' );
|
57 |
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: multilingual, bilingual, translate, translation, language, multilanguage,
|
|
5 |
Requires at least: 4.7
|
6 |
Tested up to: 5.3
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 2.6.
|
9 |
License: GPLv3 or later
|
10 |
|
11 |
Making WordPress multilingual
|
@@ -77,6 +77,14 @@ Don't hesitate to [give your feedback](http://wordpress.org/support/view/plugin-
|
|
77 |
|
78 |
== Changelog ==
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
= 2.6.9 (2020-01-15) =
|
81 |
|
82 |
* Pro: Use 'parse_query' rather than 'rest_{$type}_query' to filter REST requests.
|
5 |
Requires at least: 4.7
|
6 |
Tested up to: 5.3
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 2.6.10
|
9 |
License: GPLv3 or later
|
10 |
|
11 |
Making WordPress multilingual
|
77 |
|
78 |
== Changelog ==
|
79 |
|
80 |
+
= 2.6.10 (2020-02-19) =
|
81 |
+
|
82 |
+
* Pro: Fix sticky posts not filtered in REST API (introduced in 2.6.9)
|
83 |
+
* Fix wrong language detected if a child page uses the slug of another language
|
84 |
+
* Fix a PHP notice with PHP 7.4. #438
|
85 |
+
* Fix lang-item-first class in language switcher when the current language is hidden. #445
|
86 |
+
* Fix partially a conflict with Fusion Builder (the other part of the conflict being in Fusion Builder).
|
87 |
+
|
88 |
= 2.6.9 (2020-01-15) =
|
89 |
|
90 |
* Pro: Use 'parse_query' rather than 'rest_{$type}_query' to filter REST requests.
|
settings/settings-browser.php
CHANGED
@@ -15,6 +15,7 @@ class PLL_Settings_Browser extends PLL_Settings_Module {
|
|
15 |
* @param object $polylang polylang object
|
16 |
*/
|
17 |
public function __construct( &$polylang ) {
|
|
|
18 |
parent::__construct(
|
19 |
$polylang,
|
20 |
array(
|
15 |
* @param object $polylang polylang object
|
16 |
*/
|
17 |
public function __construct( &$polylang ) {
|
18 |
+
$this->options = &$polylang->options;
|
19 |
parent::__construct(
|
20 |
$polylang,
|
21 |
array(
|