| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
|
| 6 |
if ( isset( $field['post_field'] ) && $field['post_field'] === 'post_category' ) { |
| 7 |
$type = $field['type']; |
| 8 |
do_action( 'frm_after_checkbox', compact( 'field', 'field_name', 'type' ) ); |
| 9 |
} elseif ( is_array( $field['options'] ) ) { |
| 10 |
|
| 11 |
foreach ( $field['options'] as $opt_key => $opt ) { |
| 12 |
|
| 13 |
$field_val = FrmFieldsHelper::get_value_from_array( $opt, $opt_key, $field ); |
| 14 |
$opt = FrmFieldsHelper::get_label_from_array( $opt, $opt_key, $field ); |
| 15 |
?> |
| 16 |
<div class="frm_radio"> |
| 17 |
<label for="<?php echo esc_attr( $html_id . '-' . $opt_key ); ?>"> |
| 18 |
<?php |
| 19 |
|
| 20 |
$checked = FrmAppHelper::check_selected( $field['value'], $field_val ) ? 'checked="checked" ' : ' '; |
| 21 |
|
| 22 |
$other_opt = false; |
| 23 |
$other_args = FrmFieldsHelper::prepare_other_input( compact( 'field_name', 'opt_key', 'field' ), $other_opt, $checked ); |
| 24 |
?> |
| 25 |
<input type="radio" name="<?php echo esc_attr( $field_name ); ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ); ?>" value="<?php echo esc_attr( $field_val ); ?>" <?php |
| 26 |
echo $checked; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 27 |
do_action( 'frm_field_input_html', $field ); |
| 28 |
?>/> |
| 29 |
<?php echo ' ' . FrmAppHelper::kses( $opt, 'all' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 30 |
</label> |
| 31 |
<?php |
| 32 |
FrmFieldsHelper::include_other_input( |
| 33 |
array( |
| 34 |
'other_opt' => $other_opt, |
| 35 |
'read_only' => false, |
| 36 |
'checked' => $checked, |
| 37 |
'name' => $other_args['name'], |
| 38 |
'value' => $other_args['value'], |
| 39 |
'field' => $field, |
| 40 |
'html_id' => $html_id, |
| 41 |
'opt_key' => $opt_key, |
| 42 |
'opt_label' => $opt, |
| 43 |
) |
| 44 |
); |
| 45 |
|
| 46 |
unset( $other_opt, $other_args ); |
| 47 |
?> |
| 48 |
</div> |
| 49 |
<?php |
| 50 |
} |
| 51 |
} |
| 52 |
|