Open
Reported for: WPML Multilingual CMS 4.7.6
Overview of the issue
WPML comes with some default styles that are applied to the language switcher so that it looks proper.
You can however disable that via a constant:
define('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true);
Doing so, normally stops the built-in styles from being loaded, however in the case of the Gutenberg block for the language switcher – this is not true and the built-in styles are still loaded.
Workaround
Our developers are working on the case, however, if this is critical to you, you can go to the file /wp-content/plugins/sitepress-multilingual-cms/classes/block-editor/Loader.php
There in the function
private function styleLanguageSwitcher() {
You can add this code:
if (defined('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS')) { return ''; }
And by doing this, the constant ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS will be respected and the built-in CSS won’t be loaded for the language switcher.