diff --git a/CHANGELOG.md b/CHANGELOG.md index 1721451..7cb19fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 1.3.2 + ++ _Requires Gutenberg 4.1.0 & WordPress 4.9_ ++ _Tested up to WordPress 5.0_ + +### Bug fixes + +- Dubber block: make sure to remove footprints of the language blocks that are not displayed. + ## 1.3.1 + _Requires Gutenberg 4.1.0 & WordPress 4.9_ diff --git a/gutenblocks.php b/gutenblocks.php index ce36b65..2f813d4 100644 --- a/gutenblocks.php +++ b/gutenblocks.php @@ -3,7 +3,7 @@ * Plugin Name: GutenBlocks * Plugin URI: https://imathi.eu/tag/gutenblocks/ * Description: Ma collection personnelle de blocs Gutenberg. - * Version: 1.3.1 + * Version: 1.3.2 * Requires at least: 4.9 * Tested up to: 5.0 * License: GNU/GPL 2 @@ -68,7 +68,7 @@ public static function start() { */ private function globals() { // Version - $this->version = '1.3.1'; + $this->version = '1.3.2'; // Domain $this->domain = 'gutenblocks'; diff --git a/inc/functions.php b/inc/functions.php index 7e10553..bf2bc0c 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -941,29 +941,13 @@ function gutenblocks_translate_blocks( $content = '' ) { // Remove all other languages blocks' content. $content = str_replace( $innerblock['innerHTML'], '', $content ); - $blockname = str_replace( '/', '\/', - str_replace( 'core/', '(?:core/)?', - preg_quote( $innerblock['blockName'] ) - ) - ); - - $layout = ! empty( $block['attrs']['layout'] ) ? $block['attrs']['layout'] : false; - - if ( $layout ) { - $footprint = ( - '/.*\)(.|\n)*?()/'; + + // Remove the dubber language container + $content = preg_replace( $footprint, '', $content, 1 ); } } diff --git a/package.json b/package.json index 994e9f0..1d185b5 100644 --- a/package.json +++ b/package.json @@ -36,5 +36,5 @@ "type": "git", "url": "https://github.com/imath/gutenblocks.git" }, - "version": "1.3.1" + "version": "1.3.2" }