$opt ) { if ( isset( $shortcode_atts ) && isset( $shortcode_atts['opt'] ) && ( $shortcode_atts['opt'] !== $opt_key ) ) { continue; } $field_val = FrmFieldsHelper::get_value_from_array( $opt, $opt_key, $field ); $opt = FrmFieldsHelper::get_label_from_array( $opt, $opt_key, $field ); /** * Allows changing the HTML of option label in choice field (radio, checkbox,...). * * @since 5.0.04 * * @param string $label Label HTML. * @param array $args The arguments. Contains `field`. */ $label = apply_filters( 'frm_choice_field_option_label', $opt, compact( 'field' ) ); $checked = ''; // init if ( ! FrmFieldsHelper::is_other_opt( $opt_key ) ) { // Let the checked state of 'Other' fields be determined solely by FrmFieldsHelper::prepare_other_input as below. // Without this check, one 'Other' field being checked leads to making all 'Other' fields checked on submit error // since they all have the same value attr of 'Other'. $checked = FrmAppHelper::check_selected( $field['value'], $field_val ) ? ' checked="checked"' : ''; } // Check if other opt, and get values for other field if needed $other_opt = false; $other_args = FrmFieldsHelper::prepare_other_input( compact( 'field', 'field_name', 'opt_key' ), $other_opt, $checked ); ?>