API / Minn\Runtime / ApplicationPasswordEvents

ApplicationPasswordEvents final class

Minn\Runtime\ApplicationPasswordEvents · public/minn/src/Minn/Runtime/ApplicationPasswordEvents.php · 46 lines

Application password changes made over REST, as the reference makes them (probe rest-application-password-hooks): the prepared item (the name, and an app id a new one is given) through rest_pre_insert_application_password, then WP_Application_Passwords (which tells plugins through wp_create_, wp_update_ and wp_delete_application_password), then rest_after_insert_application_password.

Public

staticcreate(int $userId, array $body, WP_REST_Request $request): WP_Error|array#

A new password: its record and its plain text in groups of four, or the reference's refusal.

$bodyarray<string, mixed>
@return array{0: array<string, mixed>, 1: string}|\WP_Error
staticupdate(int $userId, string $uuid, array $body, WP_REST_Request $request): WP_Error|array#

A password renamed (when the body names it): its record as it stands.

$bodyarray<string, mixed>
@return array<string, mixed>|\WP_Error

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privateprepared(array $fields, WP_REST_Request $request): object#

The item the request prepares (its name; a new one's app id), through rest_pre_insert_application_password. @param array<string, mixed> $fields

$fieldsarray<string, mixed>