Polylang - Version 2.6.9

Version Description

(2020-01-15) =

  • Pro: Use 'parse_query' rather than 'rest_{$type}_query' to filter REST requests.
  • Pro: Filter the comments REST endpoint.
  • Pro: Fix duplication of terms without language.
  • Pro: Fix fatal error when Admin Columns is activated and no language is defined yet.
  • Fix shortlink when using one subdomain or domain per language
Download this release

Release Info

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

Code changes from version 2.6.8 to 2.6.9

frontend/frontend-filters-links.php CHANGED
@@ -40,6 +40,8 @@ class PLL_Frontend_Filters_Links extends PLL_Filters_Links {
40
  // Rewrites next and previous post links when not automatically done by WordPress
41
  add_filter( 'get_pagenum_link', array( $this, 'archive_link' ), 20 );
42
 
 
 
43
  // Rewrites ajax url
44
  add_filter( 'admin_url', array( $this, 'admin_url' ), 10, 2 );
45
  }
@@ -147,6 +149,20 @@ class PLL_Frontend_Filters_Links extends PLL_Filters_Links {
147
  return $_link;
148
  }
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  /**
151
  * Outputs references to translated pages ( if exists ) in the html head section
152
  *
40
  // Rewrites next and previous post links when not automatically done by WordPress
41
  add_filter( 'get_pagenum_link', array( $this, 'archive_link' ), 20 );
42
 
43
+ add_filter( 'get_shortlink', array( $this, 'shortlink' ), 20, 2 );
44
+
45
  // Rewrites ajax url
46
  add_filter( 'admin_url', array( $this, 'admin_url' ), 10, 2 );
47
  }
149
  return $_link;
150
  }
151
 
152
+ /**
153
+ * Modifies the post short link when using one domain or subdomain per language.
154
+ *
155
+ * @since 2.6.9
156
+ *
157
+ * @param string $link Post permalink.
158
+ * @param int $post_id Post id.
159
+ * @return Post permalink with the correct domain.
160
+ */
161
+ public function shortlink( $link, $post_id ) {
162
+ $post_type = get_post_type( $post_id );
163
+ return $this->model->is_translated_post_type( $post_type ) ? $this->links_model->switch_language_in_link( $link, $this->model->post->get_language( $post_id ) ) : $link;
164
+ }
165
+
166
  /**
167
  * Outputs references to translated pages ( if exists ) in the html head section
168
  *
include/rest-request.php CHANGED
@@ -10,6 +10,7 @@
10
  * links_model => inherited, reference to PLL_Links_Model object
11
  * links => reference to PLL_Admin_Links object
12
  * static_pages => reference to PLL_Static_Pages object
 
13
  * filters_links => reference to PLL_Filters_Links object
14
  * posts => reference to PLL_CRUD_Posts object
15
  * terms => reference to PLL_CRUD_Terms object
@@ -18,7 +19,7 @@
18
  * @since 2.6
19
  */
20
  class PLL_REST_Request extends PLL_Base {
21
- public $links, $posts, $terms, $filters_links, $sync;
22
 
23
  /**
24
  * Setup filters
@@ -34,6 +35,7 @@ class PLL_REST_Request extends PLL_Base {
34
  do_action( 'pll_no_language_defined' ); // To load overridden textdomains.
35
 
36
  $this->filters_links = new PLL_Filters_Links( $this );
 
37
 
38
  // Static front page and page for posts
39
  if ( 'page' === get_option( 'show_on_front' ) ) {
10
  * links_model => inherited, reference to PLL_Links_Model object
11
  * links => reference to PLL_Admin_Links object
12
  * static_pages => reference to PLL_Static_Pages object
13
+ * filters => reference to PLL_Frontend_Filters object
14
  * filters_links => reference to PLL_Filters_Links object
15
  * posts => reference to PLL_CRUD_Posts object
16
  * terms => reference to PLL_CRUD_Terms object
19
  * @since 2.6
20
  */
21
  class PLL_REST_Request extends PLL_Base {
22
+ public $links, $static_pages, $posts, $terms, $filters, $filters_links, $sync;
23
 
24
  /**
25
  * Setup filters
35
  do_action( 'pll_no_language_defined' ); // To load overridden textdomains.
36
 
37
  $this->filters_links = new PLL_Filters_Links( $this );
38
+ $this->filters = new PLL_Filters( $this );
39
 
40
  // Static front page and page for posts
41
  if ( 'page' === get_option( 'show_on_front' ) ) {
modules/plugins/plugins-compat.php CHANGED
@@ -110,11 +110,6 @@ class PLL_Plugins_Compat {
110
  $this->divi_builder = new PLL_Divi_Builder();
111
  }
112
 
113
- // Admin Columns & Admin Columns Pro
114
- if ( ( defined( 'AC_FILE' ) || defined( 'ACP_FILE' ) ) && class_exists( 'PLL_CPAC' ) ) {
115
- add_action( 'admin_init', array( $this->cpac = new PLL_CPAC(), 'init' ) );
116
- }
117
-
118
  // WP Offload Media Lite
119
  if ( function_exists( 'as3cf_init' ) && class_exists( 'PLL_AS3CF' ) ) {
120
  add_action( 'pll_init', array( $this->as3cf = new PLL_AS3CF(), 'init' ) );
@@ -136,6 +131,11 @@ class PLL_Plugins_Compat {
136
  if ( defined( 'ACF_VERSION' ) && version_compare( ACF_VERSION, '5.7.11', '>=' ) && class_exists( 'PLL_ACF' ) ) {
137
  add_action( 'init', array( $this->acf = new PLL_ACF(), 'init' ) );
138
  }
 
 
 
 
 
139
  }
140
 
141
  /**
110
  $this->divi_builder = new PLL_Divi_Builder();
111
  }
112
 
 
 
 
 
 
113
  // WP Offload Media Lite
114
  if ( function_exists( 'as3cf_init' ) && class_exists( 'PLL_AS3CF' ) ) {
115
  add_action( 'pll_init', array( $this->as3cf = new PLL_AS3CF(), 'init' ) );
131
  if ( defined( 'ACF_VERSION' ) && version_compare( ACF_VERSION, '5.7.11', '>=' ) && class_exists( 'PLL_ACF' ) ) {
132
  add_action( 'init', array( $this->acf = new PLL_ACF(), 'init' ) );
133
  }
134
+
135
+ // Admin Columns & Admin Columns Pro
136
+ if ( did_action( 'pll_init' ) && ( defined( 'AC_FILE' ) || defined( 'ACP_FILE' ) ) && class_exists( 'PLL_CPAC' ) ) {
137
+ add_action( 'admin_init', array( $this->cpac = new PLL_CPAC(), 'init' ) );
138
+ }
139
  }
140
 
141
  /**
polylang.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  Plugin Name: Polylang
5
  Plugin URI: https://polylang.pro
6
- Version: 2.6.8
7
  Author: WP SYNTEX
8
  Author uri: https://polylang.pro
9
  Description: Adds multilingual capability to WordPress
@@ -13,7 +13,7 @@ Domain Path: /languages
13
 
14
  /*
15
  * Copyright 2011-2019 Frédéric Demarle
16
- * Copyright 2019 WP SYNTEX
17
  *
18
  * This program is free software: you can redistribute it and/or modify
19
  * it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@ if ( defined( 'POLYLANG_BASENAME' ) ) {
51
  }
52
  } else {
53
  // Go on loading the plugin
54
- define( 'POLYLANG_VERSION', '2.6.8' );
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.9
7
  Author: WP SYNTEX
8
  Author uri: https://polylang.pro
9
  Description: Adds multilingual capability to WordPress
13
 
14
  /*
15
  * Copyright 2011-2019 Frédéric Demarle
16
+ * Copyright 2019-2020 WP SYNTEX
17
  *
18
  * This program is free software: you can redistribute it and/or modify
19
  * it under the terms of the GNU General Public License as published by
51
  }
52
  } else {
53
  // Go on loading the plugin
54
+ define( 'POLYLANG_VERSION', '2.6.9' );
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.8
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.8 (2019-12-11) =
81
 
82
  * Pro: Fix conflict with JetThemesCore from Crocoblock
5
  Requires at least: 4.7
6
  Tested up to: 5.3
7
  Requires PHP: 5.6
8
+ Stable tag: 2.6.9
9
  License: GPLv3 or later
10
 
11
  Making WordPress multilingual
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.
83
+ * Pro: Filter the comments REST endpoint.
84
+ * Pro: Fix duplication of terms without language.
85
+ * Pro: Fix fatal error when Admin Columns is activated and no language is defined yet.
86
+ * Fix shortlink when using one subdomain or domain per language
87
+
88
  = 2.6.8 (2019-12-11) =
89
 
90
  * Pro: Fix conflict with JetThemesCore from Crocoblock