From e56e17db61b67a092c9c53f6b7bd47d399c6578d Mon Sep 17 00:00:00 2001 From: girishpanchal30 Date: Tue, 24 Nov 2026 11:48:36 +0530 Subject: [PATCH 1/2] fix: update theme mod keys for WPML compatibility --- tests/test-wpml-compatibility.php | 45 +++++++++++++++++++++++++++++++ wpml-config.xml | 11 ++++++-- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/tests/test-wpml-compatibility.php b/tests/test-wpml-compatibility.php index 5e780b884c..cc240125ce 100644 --- a/tests/test-wpml-compatibility.php +++ b/tests/test-wpml-compatibility.php @@ -46,4 +46,49 @@ public function test_wpml_compatibility_featured_post() { $filtered_posts = apply_filters( 'neve_filter_featured_posts', $posts ); $this->assertEquals( $original_post_id, reset($filtered_posts ), 'WPML compatibility should filter posts' ); } + + /** + * Theme mod keys registered for translation in wpml-config.xml. + * + * @return list + */ + private function get_wpml_theme_mod_keys(): array { + $config = simplexml_load_file( get_template_directory() . '/wpml-config.xml' ); + $this->assertNotFalse( $config, 'wpml-config.xml should be valid XML' ); + + $keys = []; + foreach ( $config->xpath( '/wpml-config/admin-texts/key[@name="theme_mods_neve"]/key' ) as $key ) { + $keys[] = (string) $key['name']; + } + + return $keys; + } + + public function test_wpml_config_lists_free_text_theme_mods(): void { + $keys = $this->get_wpml_theme_mod_keys(); + + $expected = [ + \HFG\Core\Components\CustomHtml::COMPONENT_ID . '_' . \HFG\Core\Components\CustomHtml::CONTENT_ID, + 'footer_copyright_content', + \HFG\Core\Components\Button::COMPONENT_ID . '_' . \HFG\Core\Components\Button::TEXT_ID, + \HFG\Core\Components\Button::COMPONENT_ID . '_' . \HFG\Core\Components\Button::LINK_ID, + \HFG\Core\Components\Search::COMPONENT_ID . '_' . \HFG\Core\Components\Search::PLACEHOLDER_ID, + \HFG\Core\Components\Search::COMPONENT_ID . '_' . \HFG\Core\Components\Utility\SearchIconButton::BUTTON_TEXT, + \HFG\Core\Components\SearchResponsive::COMPONENT_ID . '_' . \HFG\Core\Components\SearchResponsive::PLACEHOLDER_ID, + 'neve_metadata_separator', + 'neve_single_post_metadata_separator', + 'neve_scroll_to_top_label', + ]; + + foreach ( $expected as $key ) { + $this->assertContains( $key, $keys, "wpml-config.xml should register the {$key} theme mod" ); + } + } + + public function test_wpml_config_omits_theme_mods_the_theme_never_reads(): void { + $keys = $this->get_wpml_theme_mod_keys(); + + $this->assertNotContains( 'neve_footer_text', $keys ); + $this->assertNotContains( 'neve_read_more_text', $keys ); + } } diff --git a/wpml-config.xml b/wpml-config.xml index 57417c6c3e..cc741a0ef5 100644 --- a/wpml-config.xml +++ b/wpml-config.xml @@ -9,11 +9,9 @@ - - @@ -21,6 +19,15 @@ + + + + + + + + + From 3af5328d422e0572a2fe8a4a24a85ecc5afff103 Mon Sep 17 00:00:00 2001 From: girishpanchal30 Date: Tue, 24 Nov 2026 16:07:04 +0530 Subject: [PATCH 2/2] fix: add legacy top bar content key for WPML compatibility --- tests/test-wpml-compatibility.php | 2 ++ wpml-config.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/tests/test-wpml-compatibility.php b/tests/test-wpml-compatibility.php index cc240125ce..4bad88cd1f 100644 --- a/tests/test-wpml-compatibility.php +++ b/tests/test-wpml-compatibility.php @@ -69,6 +69,8 @@ public function test_wpml_config_lists_free_text_theme_mods(): void { $expected = [ \HFG\Core\Components\CustomHtml::COMPONENT_ID . '_' . \HFG\Core\Components\CustomHtml::CONTENT_ID, + // Legacy top bar text, the Custom HTML default on migrated sites. + 'neve_top_bar_content', 'footer_copyright_content', \HFG\Core\Components\Button::COMPONENT_ID . '_' . \HFG\Core\Components\Button::TEXT_ID, \HFG\Core\Components\Button::COMPONENT_ID . '_' . \HFG\Core\Components\Button::LINK_ID, diff --git a/wpml-config.xml b/wpml-config.xml index cc741a0ef5..dc866eade4 100644 --- a/wpml-config.xml +++ b/wpml-config.xml @@ -21,6 +21,7 @@ +