i4w_nickname

Usage:

This filter hook enables you to influence and manipulate the WordPress field ‘nickname’ 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:

$nicknamecontains the default WordPress field value of “nickname”.
$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).
$arrINFUcontains an array of all Infusionsoft contact record fields.

Example:

function my_i4w_nickname_hook($nickname, $first_name, $last_name, $arrINFU) {
  // In this simple example, we only check if a nickname exist and if not
  // we use the first name only.
  IF (trim($nickname) == '') :
    return ucfirst(trim($first_name));
  ENDIF;
  return $nickname;
}
add_filter('i4w_nickname', 'my_i4w_nickname_hook', 10, 4);