AnsPress_Form::radio_field( array $field = array() )
Description #
Radio field.
Parameters #
- $fieldarray (Optional) Field. Default value: array()
Source #
File: includes/class/form.php
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | 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