Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gravity Perks // GF Populate Anything // Only Show Unique Choices
<?php
/**
* Gravity Perks // GF Populate Anything // Only Show Unique Choices
* http://gravitywiz.com/documentation/gravity-forms-populate-anything/
*/
add_filter( 'gppa_input_choices', function( $choices ) {
global $gppa_uniques;
$gppa_uniques = array();
$choices = array_filter( $choices, function( $var ) {
global $gppa_uniques;
if( ! in_array( $var['value'], $gppa_uniques ) ) {
$gppa_uniques[] = $var['value'];
return true;
}
return false;
} );
return $choices;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.