Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 12d57bb

Browse files
committed
Merge branch 'release/2.2.1'
2 parents c98350e + 282fa20 commit 12d57bb

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

includes/class-wp-multilang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class WP_Multilang {
2121
*
2222
* @var string
2323
*/
24-
public $version = '2.2.0';
24+
public $version = '2.2.1';
2525

2626
/**
2727
* The single instance of the class.

includes/integrations/class-wpm-acf.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ public function __construct() {
3030
add_filter( 'wpm_acf_text_config', '__return_empty_array' );
3131
add_filter( 'wpm_acf_textarea_config', '__return_empty_array' );
3232
add_filter( 'wpm_acf_wysiwyg_config', '__return_empty_array' );
33-
add_action( 'admin_init', array( $this, 'admin_init' ) );
34-
remove_class_filter( 'wp_edit_nav_menu_walker', 'acf_form_nav_menu', 'wp_edit_nav_menu_walker' );
35-
add_filter( 'wp_edit_nav_menu_walker', array($this, 'wp_edit_nav_menu_walker'), 10, 2 );
3633
}
3734

3835
/**
@@ -45,6 +42,9 @@ public function init_filters() {
4542
add_filter( 'acf/get_field_label', 'wpm_translate_string', 6 );
4643
add_filter( 'acf/update_field', array( $this, 'update_field_pro' ), 99 );
4744
add_filter( 'acf/update_value', array( $this, 'update_value_pro' ), 99, 3 );
45+
add_action( 'admin_init', array( $this, 'admin_init' ) );
46+
remove_class_filter( 'wp_edit_nav_menu_walker', 'acf_form_nav_menu', 'wp_edit_nav_menu_walker' );
47+
add_filter( 'wp_edit_nav_menu_walker', array( $this, 'wp_edit_nav_menu_walker' ), 10, 2 );
4848
} else {
4949
add_filter( 'wpm_post_acf_config', array( $this, 'add_config' ) );
5050
add_filter( 'acf/field_group/get_fields', 'wpm_translate_value', 6 );

includes/wpm-translation-functions.php

+2-8
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function wpm_translate_url( $url, $language = '' ) {
8585
*/
8686
function wpm_translate_string( $string, $language = '' ) {
8787

88-
if ( ! is_string( $string ) || is_serialized_string( $string ) || json_decode( $string ) ) {
88+
if ( ! wpm_is_ml_string( $string ) ) {
8989
return $string;
9090
}
9191

@@ -509,13 +509,7 @@ function wpm_is_ml_string( $string ) {
509509
return false;
510510
}
511511

512-
$blocks = preg_split( '#(<!--:[a-z-]+-->|<!--:-->|\[:[a-z-]+\]|\[:\]|\{:[a-z-]+\}|\{:\})#ism', $string, - 1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
513-
514-
if ( is_array( $blocks ) && ! empty( $blocks ) && count( $blocks ) > 1 ) {
515-
return true;
516-
}
517-
518-
return false;
512+
return preg_match( '#^(<!--:[a-z-]+-->|\[:[a-z-]+\]|\{:[a-z-]+\}).+#ism', $string );
519513
}
520514

521515
/**

readme.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Contributors: valexar
44
Tags: localization, multilanguage, multilingual, translation, multilang
55
Requires at least: 4.7
66
Tested up to: 4.9
7-
Stable tag: 2.2.0
7+
Stable tag: 2.2.1
88
Requires PHP: 5.6+
99
License: GPLv3
1010
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -170,6 +170,10 @@ Not compatible with:
170170

171171
Function 'get_page_by_title' not working, because in title field are stored titles for all languages. Use function 'wpm_get_page_by_title( $title )' as solution.
172172

173+
NOTE: Because plugins have different ways of storing data, WP Multilang is not compatible with every single plugin out-of-the-box (mostly page builders). This may result in texts not being translatable or translations not being saved. Most of these issues can be resolved using the integration options (wpm-config.json or filters) of WP Multilang.
174+
175+
Please try WP Multilang in a test-environment before activating it on an existing production site and always make a backup before activating!
176+
173177
== Installation ==
174178

175179
1. Upload the plugin files to the `/wp-content/plugins/wp-multilang` directory, or install the plugin through the WordPress plugins screen directly.
@@ -196,6 +200,10 @@ If you have opened several browser tabs for editing this post in different langu
196200

197201
== Changelog ==
198202

203+
= 2.2.1 =
204+
- fixed escaping text. Have error on some sites.
205+
- fixed ACF PRO menu integration. Have error on ACFv4.
206+
199207
= 2.2.0 =
200208
- added alternate locale for opengraph in YOAST SEO
201209
- added setting default translation

wp-multilang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
1010
* Text Domain: wp-multilang
1111
* Domain Path: /languages
12-
* Version: 2.2.0
12+
* Version: 2.2.1
1313
* Copyright: © 2017-2018 Valentyn Riaboshtan
1414
*
1515
* @package WPM

0 commit comments

Comments
 (0)