Commit 915ae83234d for woocommerce
commit 915ae83234dec9e5c84549bec4b24972ffa891f4
Author: Luigi Teschio <gigitux@gmail.com>
Date: Wed Oct 14 16:05:37 2026 +0200
Fix normalization of extracted pattern titles (#69810)
* Fix normalization of extracted pattern titles
* Add changelog entry for pattern title normalization
* Update plugins/woocommerce/changelog/fix-pattern-title-normalization
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
* remove changelog
---------
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
diff --git a/plugins/woocommerce/bin/class-generate-pattern-translations.php b/plugins/woocommerce/bin/class-generate-pattern-translations.php
index f6e16cce98f..0d083320f0f 100644
--- a/plugins/woocommerce/bin/class-generate-pattern-translations.php
+++ b/plugins/woocommerce/bin/class-generate-pattern-translations.php
@@ -8,6 +8,9 @@
namespace Automattic\WooCommerce\Tools;
use WP_CLI\I18n\FileDataExtractor;
+use WP_CLI\Utils;
+
+require_once __DIR__ . '/composer/wp/vendor/wp-cli/wp-cli/php/utils-wp.php';
/**
* Generates extractable PHP strings from pattern headers.
@@ -40,6 +43,9 @@ class Generate_Pattern_Translations {
)
);
foreach ( $headers as $context => $text ) {
+ if ( 'Pattern title' === $context ) {
+ $text = Utils\strip_tags( html_entity_decode( (string) $text, ENT_QUOTES | ENT_HTML5, 'UTF-8' ) );
+ }
if ( '' === $text ) {
continue;
}