function hook_available_conditions_alter in Theme Switcher Rules 8
Allows modules to modify the conditions available.
This hook allows modules to unset some conditions to be unavailable on the theme_switcher_rule form. Some conditions may not make sense.
Parameters
array $definitions: An array with all available conditions.
1 function implements hook_available_conditions_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- theme_switcher_available_conditions_alter in ./
theme_switcher.module - Implements available_conditions_alter().
1 invocation of hook_available_conditions_alter()
- ThemeSwitcherRuleForm::form in src/
Form/ ThemeSwitcherRuleForm.php - Gets the actual form array to be built.
File
- ./
theme_switcher.api.php, line 17 - API documentation file for the module.
Code
function hook_available_conditions_alter(array &$definitions) {
foreach ($definitions as $condition_id => $definition) {
// Don't use the current theme condition.
if ($condition_id == 'current_theme') {
unset($definitions[$condition_id]);
}
}
}