Skip to content

Commit 24b6acf

Browse files
dariospacespivurno
andcommitted
Create gppa-remove-default-behavior-using-comma.php (#440)
* Create gppa-remove-default-behavior-using-comma.php added hook * Update gppa-remove-default-behavior-using-comma.php fixed phpcs errors * Update and rename gppa-remove-default-behavior-using-comma.php to gppa-use-line-break-as-value-separator.php Co-authored-by: David Smith <david@gravitywiz.com>
1 parent b70bb07 commit 24b6acf

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
/**
3+
* Gravity Perks // GP Populate Anything // Use Line Breaks as Value Separator
4+
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
5+
*/
6+
add_filter( 'gppa_array_value_to_text', function( $text_value, $array_value, $field ) {
7+
if ( $field->type !== 'textarea' ) {
8+
return $text_value;
9+
}
10+
return implode( "\n", $array_value );
11+
}, 11, 3 );

0 commit comments

Comments
 (0)