$user


User Methods

$user->set($property, $value)

Introduced in Version 2.0

Description

Set a property value. Same as $user->[property] = $value;

Changing the user's login name and saving that change:

setOutputFormatting(false) is required when editing data in a user's fields.

$item = $users->get('myname');
$item->setOutputFormatting(false);
$item->set('name', $sanitizer->pageName("newname"));
$users->save($item);

You could also use this:

$item->name = ...				

instead of this:

$item->set('name', ...)

Post Comment