getFieldName($block) . ']'; $automationId = ($block['id'] == 'status') ? 'data-automation-id="form_status"' : ''; $html .= '
'; $html .= $this->renderLabel($block); $html .= ''; if (isset($block['params']['label_within']) && $block['params']['label_within']) { $label = $this->getFieldLabel($block); if (!empty($block['params']['required'])) { $label .= ' *'; } $html .= '' . $label . ''; } else { if (empty($block['params']['required']) || !$block['params']['required']) { $html .= '-'; } } $options = (!empty($block['params']['values']) ? $block['params']['values'] : [] ); foreach ($options as $option) { if (!empty($option['is_hidden'])) { continue; } $isSelected = ( (isset($option['is_checked']) && $option['is_checked']) || (self::getFieldValue($block) === $option['value']) ) ? ' selected="selected"' : ''; $isDisabled = (!empty($option['is_disabled'])) ? ' disabled="disabled"' : ''; if (is_array($option['value'])) { $value = key($option['value']); $label = reset($option['value']); } else { $value = $option['value']; $label = $option['value']; } $html .= ''; $html .= $this->wp->escAttr($label); $html .= ''; } $html .= ''; $html .= '