UserWrites final class
Minn\Runtime\UserWrites · public/minn/src/Minn/Runtime/UserWrites.php · 354 lines
Accounts written as WordPress's user functions write them: an account made, changed (its row, profile meta and role, with the notices a changed password or email sends) and deleted (its posts deleted or handed on), a reset key issued, the lookups that guard a new account, and the cached rows let go; each step with the actions and filters the reference fires in its order.
Uses 25 (show)
Public
| static | validUsername(mixed $username): bool# | Whether a username survives strict sanitising unchanged and is not empty (validate_username), as validate_username leaves it. |
| static | usernameExists(mixed $username): mixed# | The id of the account with the login (username_exists), or false, as username_exists leaves it. |
| static | emailExists(mixed $email): mixed# | The id of the account with the email (email_exists), or false, as email_exists leaves it. |
| static | isMember(mixed $userId = 0, mixed $blogId = 0): bool# | Whether the user (the signed-in one when none is named) belongs to the site (is_user_member_of_blog). |
| static | appPasswordsAvailable(): bool# | Whether the site offers application passwords (wp_is_application_passwords_available): over HTTPS or on a local site, as the filter leaves it. |
| static | appPasswordsAvailableFor(mixed $user): bool# | Whether a user may sign in by application password (wp_is_application_passwords_available_for_user): the site allows them, then the filter. |
| static | resetKey(mixed $user): mixed# | A fresh reset key (get_password_reset_key), its hash stored under the time it was issued through the account's save; the refusal when the account may not reset. |
| static | create(mixed $username, mixed $password, mixed $email = ''): mixed# | A new account (wp_create_user) from a login, password and email. |
| static | insert(mixed $userdata): mixed# | An account made or changed (wp_insert_user): each field through its pre_user_ filter first, in the reference's order; its id, or the error saying why not. |
| static | update(mixed $userdata): mixed# | An account changed (wp_update_user): the stored account and its profile under the given fields, as the reference merges them, then the notices a changed password or email sends. |
| static | delete(mixed $id, mixed $reassign = NULL): bool# | An account deleted (wp_delete_user): its posts deleted, or handed to the account named; each meta key removed with its own actions, then the row; false for an unknown account. |
| static | cleanCache(mixed $user): void# | A user's cached rows and meta let go (clean_user_cache), plugins told. |
| static | row(mixed $user): ?Minn\Content\UserRecord# | An account's row from an id, a login, a user object, or an object with an ID. |
Internals 5
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | asArray(mixed $userdata): array# | @return array<string, mixed> the account's fields from an array, a plain object or a user object | |||||||||
| private | insertAccount(array $account, array $userdata): int# | A new account as the reference writes it: the row, wp_set_password, each profile meta added, the role, the caches let go, then user_register. A role given as false leaves the account without one for the caller to add.
| |||||||||
| private | filteredRow(array $account, array $userdata): array# | A new account's row through wp_pre_insert_user_data, as the reference hands it (the password hashed), and back.
@return array<string, mixed> | |||||||||
| private | updateProfile(Minn\Objects\User $existing, array $userdata, array $resolved, array $given = array ( )): int# | The update half of wp_insert_user: the changed columns, the profile meta, the role.
| |||||||||
| private | changeNotices(array $user, array $userdata): void# | The notices a user whose password or email address just changed is mailed, to the address they had.
|
Nothing matches.