function hook_ui_pattern_settings_settings_alter in UI Patterns Settings 8.2
Alter UI Patterns Settings settings before they are printed.
Implement this hook to override the configured pattern settings for specific patterns or to configure custom setting logic.
Parameters
array $settings: Pattern settings.
array $context: Context Properties: The context and the entity of the pattern. keys:
- #pattern_id: The pattern id.
- #variant: The variant id.
- #context: The pattern context
See also
\Drupal\ui_patterns_settings\Element\PatternSettings
1 invocation of hook_ui_pattern_settings_settings_alter()
- PatternSettings::processSettings in src/
Element/ PatternSettings.php - Process settings.
File
- ./
ui_patterns_settings.api.php, line 25 - API file.
Code
function hook_ui_pattern_settings_settings_alter(array &$settings, array $context) {
if ($context['#pattern_id'] === 'button') {
$settings['padding_bottom'] = 'large';
}
}