Version Description
(2019-02-12) =
- Pro: Fix translated slugs not accepting forward slashes
- Pro: Fix fatal error with ACF Pro 5.7.11
- Fix parent categories incorrectly synchronized #327
Download this release
Release Info
Developer | Chouby |
Plugin | Polylang |
Version | 2.5.2 |
Comparing to | |
See all releases |
Code changes from version 2.5.1 to 2.5.2
- modules/sync/sync.php +7 -7
- polylang.php +2 -2
- readme.txt +9 -3
modules/sync/sync.php
CHANGED
@@ -24,7 +24,8 @@ class PLL_Sync {
|
|
24 |
$this->term_metas = new PLL_Sync_Term_Metas( $polylang );
|
25 |
|
26 |
add_action( 'pll_save_post', array( $this, 'pll_save_post' ), 10, 3 );
|
27 |
-
add_action( '
|
|
|
28 |
|
29 |
add_action( 'pll_duplicate_term', array( $this->term_metas, 'copy' ), 10, 3 );
|
30 |
|
@@ -108,20 +109,19 @@ class PLL_Sync {
|
|
108 |
/**
|
109 |
* Synchronize term parent in translations
|
110 |
* Calling clean_term_cache *after* this is mandatory otherwise the $taxonomy_children option is not correctly updated
|
111 |
-
* Before WP 3.9 clean_term_cache could be called ( efficiently ) only one time due to static array which prevented to update the option more than once
|
112 |
-
* This is the reason to use the edit_term filter and not edited_term
|
113 |
*
|
114 |
* @since 2.3
|
115 |
*
|
116 |
-
* @param int $term_id
|
117 |
-
* @param
|
118 |
-
* @param
|
119 |
*/
|
120 |
-
public function sync_term_parent( $term_id, $
|
121 |
global $wpdb;
|
122 |
|
123 |
if ( is_taxonomy_hierarchical( $taxonomy ) && $this->model->is_translated_taxonomy( $taxonomy ) ) {
|
124 |
$term = get_term( $term_id );
|
|
|
125 |
|
126 |
foreach ( $translations as $lang => $tr_id ) {
|
127 |
if ( ! empty( $tr_id ) && $tr_id !== $term_id && $tr_parent = $this->model->term->get_translation( $term->parent, $lang ) ) {
|
24 |
$this->term_metas = new PLL_Sync_Term_Metas( $polylang );
|
25 |
|
26 |
add_action( 'pll_save_post', array( $this, 'pll_save_post' ), 10, 3 );
|
27 |
+
add_action( 'created_term', array( $this, 'sync_term_parent' ), 10, 3 );
|
28 |
+
add_action( 'edited_term', array( $this, 'sync_term_parent' ), 10, 3 );
|
29 |
|
30 |
add_action( 'pll_duplicate_term', array( $this->term_metas, 'copy' ), 10, 3 );
|
31 |
|
109 |
/**
|
110 |
* Synchronize term parent in translations
|
111 |
* Calling clean_term_cache *after* this is mandatory otherwise the $taxonomy_children option is not correctly updated
|
|
|
|
|
112 |
*
|
113 |
* @since 2.3
|
114 |
*
|
115 |
+
* @param int $term_id Term id.
|
116 |
+
* @param int $tt_id Term taxonomy id, not used.
|
117 |
+
* @param string $taxonomy Taxonomy name.
|
118 |
*/
|
119 |
+
public function sync_term_parent( $term_id, $tt_id, $taxonomy ) {
|
120 |
global $wpdb;
|
121 |
|
122 |
if ( is_taxonomy_hierarchical( $taxonomy ) && $this->model->is_translated_taxonomy( $taxonomy ) ) {
|
123 |
$term = get_term( $term_id );
|
124 |
+
$translations = $this->model->term->get_translations( $term_id );
|
125 |
|
126 |
foreach ( $translations as $lang => $tr_id ) {
|
127 |
if ( ! empty( $tr_id ) && $tr_id !== $term_id && $tr_parent = $this->model->term->get_translation( $term->parent, $lang ) ) {
|
polylang.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
Plugin Name: Polylang
|
5 |
Plugin URI: https://polylang.pro
|
6 |
-
Version: 2.5.
|
7 |
Author: Frédéric Demarle
|
8 |
Author uri: https://polylang.pro
|
9 |
Description: Adds multilingual capability to WordPress
|
@@ -53,7 +53,7 @@ if ( defined( 'POLYLANG_BASENAME' ) ) {
|
|
53 |
}
|
54 |
} else {
|
55 |
// Go on loading the plugin
|
56 |
-
define( 'POLYLANG_VERSION', '2.5.
|
57 |
define( 'PLL_MIN_WP_VERSION', '4.7' );
|
58 |
|
59 |
define( 'POLYLANG_FILE', __FILE__ ); // this file
|
3 |
/**
|
4 |
Plugin Name: Polylang
|
5 |
Plugin URI: https://polylang.pro
|
6 |
+
Version: 2.5.2
|
7 |
Author: Frédéric Demarle
|
8 |
Author uri: https://polylang.pro
|
9 |
Description: Adds multilingual capability to WordPress
|
53 |
}
|
54 |
} else {
|
55 |
// Go on loading the plugin
|
56 |
+
define( 'POLYLANG_VERSION', '2.5.2' );
|
57 |
define( 'PLL_MIN_WP_VERSION', '4.7' );
|
58 |
|
59 |
define( 'POLYLANG_FILE', __FILE__ ); // this file
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: Chouby
|
|
3 |
Donate link: https://polylang.pro
|
4 |
Tags: multilingual, bilingual, translate, translation, language, multilanguage, international, localization
|
5 |
Requires at least: 4.7
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 2.5.
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Making WordPress multilingual
|
@@ -76,7 +76,13 @@ Don't hesitate to [give your feedback](http://wordpress.org/support/view/plugin-
|
|
76 |
|
77 |
== Changelog ==
|
78 |
|
79 |
-
= 2.5.
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
* Security: Fix categories and media duplication not protected from CSRF
|
82 |
* Pro: Allow to update the plugin with WP CLI
|
3 |
Donate link: https://polylang.pro
|
4 |
Tags: multilingual, bilingual, translate, translation, language, multilanguage, international, localization
|
5 |
Requires at least: 4.7
|
6 |
+
Tested up to: 5.1
|
7 |
+
Stable tag: 2.5.2
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Making WordPress multilingual
|
76 |
|
77 |
== Changelog ==
|
78 |
|
79 |
+
= 2.5.2 (2019-02-12) =
|
80 |
+
|
81 |
+
* Pro: Fix translated slugs not accepting forward slashes
|
82 |
+
* Pro: Fix fatal error with ACF Pro 5.7.11
|
83 |
+
* Fix parent categories incorrectly synchronized #327
|
84 |
+
|
85 |
+
= 2.5.1 (2019-01-16) =
|
86 |
|
87 |
* Security: Fix categories and media duplication not protected from CSRF
|
88 |
* Pro: Allow to update the plugin with WP CLI
|