Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Gravity Perks // Populate Anything // Populate User Role
* http://gravitywiz.com/documentation/gravity-forms-populate-anything/
*/
add_filter( 'gppa_process_template', function( $value, $field, $template, $populate, $object, $object_type, $objects ) {
if( $template == 'role' && is_a( $object, 'WP_User' ) ) {
$value = implode( ', ', $object->roles );
}
return $value;
}, 10, 7 );
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.