Difference between revisions of "OnGetUserInfo"

(Description)
(Example)
 
Line 24: Line 24:
 
         return true;
 
         return true;
 
}
 
}
Result:
 
Field Value changed from "Male" to "M"
 
 
</syntaxhighlight>
 
</syntaxhighlight>
 
<br />
 
<br />
 +
Result:
 +
Field Value changed from "Male" to "M"

Latest revision as of 10:36, 15 October 2013

Description

This event is triggered when getting current logged-in user info by field code (e.g. FIELD_GENDER, FIELD_BIRTHDATE, etc). The plugin may manipulate the obtained field value provided that the extended user info configuration is enabled.

Params

An array with two items; fieldcode and fieldvalue.

Array
(
    [0] => FIELD_GENDER,
    [1] => Male (corresponding value of the fieldcode passed by reference)
)


Example

function onGetUserInfo( $arrItems ) 
{
        $arrGenderShortForm = array('male' => 'M', 'female' => 'F');
 
        $arrItems[1] = $arrGenderShortForm[$arrItems[1]];
 
        return true;
}


Result: Field Value changed from "Male" to "M"