i4w_nicename
This filter hook enables you to influence and manipulate the WordPress field ‘user_nicename’ 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
Section titled “Parameters”iMember360 will pass the following parameters to your filter function:
| Parameter | Description |
|---|---|
| $nicename | Contains the default WordPress field value of “user_nicename”. |
| $first_name | Contains the default WordPress field value of “first_name”, which is obtained from Keap (FirstName). |
| $last_name | Contains the default WordPress field value of “last_name”, which is obtained from Keap (LastName). |
| $arrINFU | Array containing the contact record fields for the person who just logged in. |
Example
Section titled “Example”function my_i4w_nicename_hook($nicename, $first_name, $last_name, $arrINFU) { // In this simple example, we create a "user_nicename" consisting // of first name and last name separated by a dash return trim($first_name) . '-' . trim($last_name);}add_filter('i4w_nicename', 'my_i4w_nicename_hook', 10, 4);