public static function Helpers::setBlockProcessing in Menu Multilingual 8
Enable menu_multilingual block processing.
2 calls to Helpers::setBlockProcessing()
File
- src/
Helpers.php, line 16
Class
- Helpers
- Various functions to assist menu_multilingual block.
Namespace
Drupal\menu_multilingualCode
public static function setBlockProcessing(&$build) {
$settings = $build['#configuration'];
if (!empty($settings['only_translated_labels']) || !empty($settings['only_translated_content'])) {
$modifier = \Drupal::service('menu_multilingual.modifier');
$modifier
->filterLabels($settings['only_translated_labels']);
$modifier
->filterContent($settings['only_translated_content']);
$build['#pre_render'][] = [
$modifier,
'filterLinksInRenderArray',
];
}
}