[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/secrets/ -> interface-wp-secrets-store.php (summary)

Secrets API: WP_Secrets_Store interface

File Size: 73 lines (2 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Secrets_Store:: (4 methods):
  get()
  set()
  delete()
  list_names()


Interface: WP_Secrets_Store  - X-Ref

Where a secret's encrypted record lives.

An implementation is never handed a plaintext secret, only the record array
produced by WP_Secrets_Cipher and assembled by the functions in secrets.php, and
cannot turn encryption off; there is no method here that accepts or returns
anything but ciphertext-bearing structures.

A platform store that is read-only from the application, with credentials managed
by a separate CLI or dashboard, returns WP_Error from set() rather than pretending
the write succeeded. Providers declare writability up front through
WP_Secrets_Provider::is_writable().

get( string $name, bool $network = false )   X-Ref
Reads a secret's stored record.

return: array<mixed>|null|WP_Error The record array if it exists. Null if it does not.
param: string $name    The secret's namespaced name.
param: bool   $network Whether this is a network-scope secret.

set( string $name, array $record, bool $network = false )   X-Ref
Writes a secret's record.

return: bool|WP_Error True on success. WP_Error on failure, including when the
param: string       $name    The secret's namespaced name.
param: array<mixed> $record  The record to store.
param: bool         $network Whether this is a network-scope secret.

delete( string $name, bool $network = false )   X-Ref
Deletes a secret's record.

return: bool|WP_Error True on success (including if it did not exist).
param: string $name    The secret's namespaced name.
param: bool   $network Whether this is a network-scope secret.

list_names( bool $network = false )   X-Ref
Lists the names of every secret in this store, for this scope. Never a value.

return: string[]|WP_Error Array of secret names on success. WP_Error on failure.
param: bool $network Whether to list network-scope secrets.



Generated : Wed Oct 14 08:20:33 2026 Cross-referenced by PHPXref