wpseek.com
A WordPress-centric search engine for devs and theme authors
_wp_secrets_get › WordPress Function
Since7.2.0
Deprecatedn/a
› _wp_secrets_get ( $name, $version, $network )
| Parameters: (3) |
|
| Returns: |
|
| Defined at: |
|
| Codex: |
Shared implementation behind wp_get_secret() and wp_get_network_secret().
Related Functions: _wp_secrets_set, _wp_secrets_delete, _wp_secrets_retire, _wp_secrets_list, _wp_secrets_get_store
Source
function _wp_secrets_get( string $name, string $version, bool $network ) {
/*
* Checked here rather than inside the provider: this is a contract between
* the API and its caller, and asking every provider to re-validate a core
* constant would be duplicated work that a third-party provider could
* silently skip.
*/
if ( ! in_array( $version, array( WP_Secret_Version::CURRENT, WP_Secret_Version::PREVIOUS ), true ) ) {
_doing_it_wrong(
__FUNCTION__,
__( 'The version must be WP_Secret_Version::CURRENT or WP_Secret_Version::PREVIOUS.' ),
'7.2.0'
);
return new WP_Error(
WP_SECRETS_ERROR_INVALID_ARGUMENT,
__( 'The version must be WP_Secret_Version::CURRENT or WP_Secret_Version::PREVIOUS.' )
);
}
return _wp_secrets_get_provider()->get( $name, $version, $network );
}