getFieldName($context);
$currentValue = $this->getMainSettingValue(null, $context);
//phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $this->buildFieldsetContainer($context, ['ame-radio-card-group-control']);
foreach ($this->getOptions($context) as $option) {
$isChecked = ($currentValue === $option->value);
echo $this->buildTag('label', array(
'class' => 'ame-radio-card',
'title' => $option->description,
));
echo '
';
echo $this->generateRadioInputFor($option, $fieldName, $isChecked, $context);
echo '
';
echo '';
$childControl = $this->getOptionChild($option->value);
if ( $childControl ) {
echo '
';
//renderElement() would often put the child control inside an auto-generated control
//group, which can mess up the layout. Let's use renderControl() if possible.
if ( $childControl instanceof Control ) {
$renderer->renderControl($childControl, $context);
} else {
$renderer->renderElement($childControl, $context, $this);
}
echo '
';
}
if ( !empty($option->label) ) {
HtmlHelper::outputTag('span', ['class' => 'ame-radio-card-label'], $option->label);
}
echo '
';
echo '';
}
echo '';
//phpcs:enable
}
}