AnsPress_Form::radio_field( array $field = array() )
Description #
Radio field.
Parameters #
- $fieldarray (Optional) Field. Default value: array()
Source #
File: includes/class/form.php
private function radio_field( $field = [] ) {
if ( isset( $field['label'] ) ) {
$this->label();
}
$this->output .= '<div class="ap-form-fields-in">';
foreach ( (array) $field['options'] as $opt_value => $opt_label ) {
$this->output .= '<label>';
$this->output .= '<input id="' . $field['name'] . '" type="radio" class="ap-form-control" value="' . esc_attr( $opt_value ) . '" name="' . $field['name'] . '" ' . checked( $opt_value, $field['value'], false ) . ' ' . $this->attr( $field ) . ' />';
$this->output .= $opt_label;
$this->output .= '</label>';
}
if ( ! $this->field['show_desc_tip'] ) {
$this->desc();
}
$this->error_messages();
$this->output .= '</div>';
}
Expand full source code Collapse full source code View on GitHub: includes/class/form.php:385
Add your comment