Skip to content Skip to sidebar

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.

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>