wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_get_secret › WordPress Function

Since7.2.0
Deprecatedn/a
› wp_get_secret ( $name, $version = WP_Secret_Version::CURRENT )
Parameters: (2)
  • (string) $name The secret's namespaced name.
    Required: Yes
  • (string) $version A WP_Secret_Version constant. Default WP_Secret_Version::CURRENT.
    Required: No
    Default: WP_Secret_Version::CURRENT
Returns:
  • (WP_Secret|null|WP_Error)
Defined at:
Codex:

Retrieves a secret.

Three states, never collapsed: a WP_Secret if it exists and decrypts, null if it does not exist, WP_Error if it exists but could not be retrieved. No capability check is applied here. See wp_set_secret().


Source

function wp_get_secret( string $name, string $version = WP_Secret_Version::CURRENT ) {
	return _wp_secrets_get( $name, $version, false );
}