Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gravity Wiz // Gravity Forms // Dynamically Populating User Role
<?php
/**
* Dynamically Populating User Role
* http://gravitywiz.com/2012/04/30/dynamically-populating-user-role/
*/
add_filter('gform_field_value_user_role', 'gform_populate_user_role');
function gform_populate_user_role($value){
$user = wp_get_current_user();
$role = $user->roles;
return reset($role);
}
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.