Skip to content

Commit 18f41fc

Browse files
Niq1982anttiviljami
authored andcommitted
Fixes ugly default mail when post field is of type array
Send prettier email in case <input type="radio" name="foo[]">
1 parent 8352dfc commit 18f41fc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

inc/wplf-form-actions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ function wplf_send_email_copy( $return ) {
2525
if( '_' === $key[0] ) {
2626
continue;
2727
}
28+
if( is_array( $value ) ) { // in case input type="radio" submits an array
29+
$value = implode( ', ', $value );
30+
}
2831
$content .= esc_html( $key ) . ': ' . esc_html( print_r( $value, true ) ) . "\n";
2932
}
3033

0 commit comments

Comments
 (0)