wpseek.com
WordPress开发者和主题制作者的搜索引擎
_wp_secrets_get is private and should not be used in themes or plugins directly.
_wp_secrets_get › WordPress Function
Since7.2.0
已弃用n/a
› _wp_secrets_get ( $name, $version, $network )
| 访问: |
|
| 参数: (3) |
|
| 返回: |
|
| 定义在: |
|
| 文档: |
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
源码
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 );
}