API / Minn\Runtime / UserSave

UserSave final class

Minn\Runtime\UserSave · public/minn/src/Minn/Runtime/UserSave.php · 74 lines

An account's fields through the filters the reference's wp_insert_user runs, in its order (probe user-insert-filters, contracts/runtime.md "Accounts plugins can change"): the login (pre_user_login), refused when illegal_user_logins names it; the nicename, made from the login for a new account (pre_user_nicename); the email and the URL; the nickname (the login when none), first and last names; the display name, made as the reference makes it when none is given; the description. Each pre_user_* filter carries the reference's sanitisers. Then wp_pre_insert_user_data over the row and insert_user_meta over the meta.

Used by 1

Public

staticfields(array $userdata, ?array $existing): Minn\Runtime\Refusal|array#

The fields after their filters, or the refusal for an illegal login.

$userdataarray<string, mixed>
$existingarray<string, mixed>|nullthe stored account on an update
@return array<string, mixed>|Refusal
staticdata(array $row, int $userId, array $userdata): array#

wp_pre_insert_user_data over the row an insert or update writes: the row, whether it updates, the account's id (null for a new one), what the caller gave.

$rowarray<string, mixed>
$userdataarray<string, mixed>
@return array<string, mixed>
staticmeta(array $meta, int $userId, array $userdata): array#

insert_user_meta over the profile meta, then insert_custom_user_meta over the meta_input the caller gave beyond it; the two merged. An update is one whose userdata names an ID.

$metaarray<string, mixed>
$userdataarray<string, mixed>
@return array<string, mixed>