protected NegotiationConfigureForm::disableLanguageSwitcher(array $language_types)
Disables the language switcher blocks.
Parameters
array $language_types: An array containing all language types whose language switchers need to be disabled.
File
- core/modules/language/src/Form/NegotiationConfigureForm.php, line 325
Class
- NegotiationConfigureForm
- Configure the selected language negotiation method for this site.
Namespace
Drupal\language\Form
Code
1 2 3 4 5 6 7 8 9 10 11 | protected function disableLanguageSwitcher( array $language_types ) { $theme = $this ->themeHandler->getDefault(); $blocks = $this ->blockStorage->loadByProperties( array ( 'theme' => $theme )); foreach ( $language_types as $language_type ) { foreach ( $blocks as $block ) { if ( $block ->getPluginId() == 'language_block:' . $language_type ) { $block -> delete (); } } } } |
Please login to continue.