Created
March 26, 2019 14:02
-
-
Save spivurno/65ad088bc50dac684167d981290295fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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