wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_set_secret › WordPress Function

Seit7.2.0
Veraltetn/v
› wp_set_secret ( $name, $value )
Parameter: (2)
  • (string) $name The secret's namespaced name ('plugin-slug/secret-name').
    Erforderlich: Ja
  • (string) $value The plaintext value to store.
    Erforderlich: Ja
Gibt zurück:
  • (true|WP_Error)
Definiert in:
Codex:

Encrypts and stores a secret.

Encryption is unconditional: there is no plaintext mode and no constant to disable it. No capability check is applied here, because this must be callable from cron, REST, and front-end requests where no user is logged in. Enforce capabilities at the operator boundary (CLI, an admin screen) instead.


Quellcode

function wp_set_secret( string $name, $value ) {
	return _wp_secrets_set( $name, $value, false );
}