Description
The filter gravityflow_assignee_choices allows the assignee choices to be modified
Parameters
Examples
Populate User email instead of User name in step settings.
add_filter( 'gravityflow_assignee_choices', 'display_user_emails', 10, 2 );
function display_user_emails( $choices, $form ) {
// Loop over "User" choices
foreach( $choices[0]['choices'] as &$choice ) {
// get user id
$user_id = explode ( '|', $choice['value'] )[1] ;
// get the user
$user = get_user_by( 'id', $user_id );
// update label to display email in place of the username
$choice['label'] = $user->user_email;
}
return $choices;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?