Skip to content

Commit

Permalink
Dev - Filter added for checkbox and radio options. (#1144)
Browse files Browse the repository at this point in the history
* Tweak - filter added to remove the image

* changelog updated
  • Loading branch information
deepench authored Aug 23, 2023
1 parent d9169a0 commit 79eab5c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
== Changelog ==

- 2.0.3 - xx-xx-2023
* Dev - Filter added for checkbox and radio options.

- 2.0.2 - 19-07-2023
* Feature - Regex validation for field.
* Feature - Custom CSS and JS for form.
Expand Down
18 changes: 14 additions & 4 deletions includes/abstracts/class-evf-form-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -2648,9 +2648,14 @@ public function field_exporter( $field ) {
case 'radio':
case 'signature':
case 'payment-multiple':
$value = '';
$image = ! empty( $field['value']['image'] ) ? sprintf( '<img src="%s" style="width:75px;height:75px;max-height:75px;max-width:75px;" /><br>', $field['value']['image'] ) : '';
$value = ! empty( $field['value']['label'] ) ? $image . $field['value']['label'] : '';
$value = '';
$image = ! empty( $field['value']['image'] ) ? sprintf( '<img src="%s" style="width:75px;height:75px;max-height:75px;max-width:75px;" /><br>', $field['value']['image'] ) : '';
$filtered_choice = apply_filters( 'evf_custom_choice', false );
if ( $filtered_choice ) {
$value = ! empty( $field['value']['label'] ) ? $field['value']['label'] : '';
} else {
$value = ! empty( $field['value']['label'] ) ? $image . $field['value']['label'] : '';
}
$export = array(
'label' => ! empty( $field['value']['name'] ) ? $field['value']['name'] : ucfirst( str_replace( '_', ' ', $field['type'] ) ) . " - {$field['id']}",
'value' => ! empty( $value ) ? $value : false,
Expand All @@ -2665,7 +2670,12 @@ public function field_exporter( $field ) {
$image = ! empty( $field['value']['images'][ $key ] ) ? sprintf( '<img src="%s" style="width:75px;height:75px;max-height:75px;max-width:75px;" /><br>', $field['value']['images'][ $key ] ) : '';

if ( ! empty( $choice ) ) {
$value[ $key ] = $image . $choice;
$filtered_choice = apply_filters( 'evf_custom_choice', false );
if ( $filtered_choice ) {
$value[ $key ] = $choice;
} else {
$value[ $key ] = $image . $choice;
}
}
}
}
Expand Down

0 comments on commit 79eab5c

Please sign in to comment.