public function RolesConditionCreator::itemSelected in Block Visibility Groups 8
Determine if a condition was selected in the form.
Parameters
$condition_info:
Return value
bool TRUE if the condition was selected in a form.
Overrides ConditionCreatorBase::itemSelected
File
- block_visibility_groups_admin/
src/ Plugin/ ConditionCreator/ RolesConditionCreator.php, line 45
Class
- RolesConditionCreator
- A condition creator to be used in creating user role condition.
Namespace
Drupal\block_visibility_groups_admin\Plugin\ConditionCreatorCode
public function itemSelected($condition_info) {
$roles = $condition_info['condition_config']['roles'];
return !empty(array_filter($roles));
}