i4w_display_name

Usage:

This hook enables you to influence and manipulate the WordPress field ‘display_name’ when the user is first created.

Unlike the “i4w_alternate_role” hook, this setting doesn’t get updated each time a user logs. The hook is only called once upon initial login so as not to disturb any other function which may rely on this setting (i.e. BuddyPress).

Parameters:

iMember360 will pass the following parameters to your filter function:

$display_namecontains the default WordPress field value of “display_name”
$first_namecontains the default WordPress field value of “first_name”, which is obtained from Infusionsoft (FirstName).
$last_namecontains the default WordPress field value of “last_name”, which is obtained from Infusionsoft (LastName).
$arrINFUis an array containing the contact record fields for the person who just logged in

Example:

function my_i4w_display_name($display_name, $first_name, $last_name, $arrINFU) {
  // In this simple example, we create a "display_name" consisting 
  // of first name and last initial only.
  return ucfirst(trim($first_name)) . ' ' . strtoupper(substr(trim($last_name),0,1)) . '.';
}
add_filter('i4w_display_name', 'my_i4w_display_name', 10, 4);