Convert Arrays To A Comma Separated List

Code

Filename: gppa-convert-arrays-to-comma-list.php

<?php
/**
 * Gravity Perks // Populate Anything // Convert Arrays To A Comma Separated List
 * https://gravitywiz.com/documentation/gravity-forms-populate-anything/
 */
add_filter( 'gppa_object_merge_tag_replacement_value', function( $replace, $object, $match ) {
	return is_array( $replace ) ? join( ', ', $replace ) : $replace;
}, 10, 3 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.