wpseek.com
WordPress开发者和主题制作者的搜索引擎
_wp_secrets_get_store is private and should not be used in themes or plugins directly.
_wp_secrets_get_store › WordPress Function
Since7.2.0
已弃用n/a
› _wp_secrets_get_store ( 没有参数 )
| 访问: |
|
| 返回: |
|
| 定义在: |
|
| 文档: |
Returns the active secret store.
No filter is applied here, or anywhere on the retrieval path. A secrets.php drop-in overrides the store by setting $GLOBALS['wp_secrets_store'] to an instance before this is first called, and that global is checked here directly, not through a hook. If the global was set but is not a valid WP_Secrets_Store, or if the drop-in itself failed to load cleanly, this returns WP_Secrets_Broken_Store rather than silently using the default: the drop-in's presence signals the operator wants storage other than local options, and falling back to local options anyway would be the exact silent downgrade this API refuses to make.Related Functions: _wp_secrets_get, _wp_secrets_get_provider, _wp_secrets_set, _wp_secrets_delete, _wp_secrets_list
源码
function _wp_secrets_get_store(): WP_Secrets_Store {
static $store = null;
if ( $store instanceof WP_Secrets_Store ) {
return $store;
}
if ( ! empty( $GLOBALS['wp_secrets_dropin_broken'] ) ) {
$store = new WP_Secrets_Broken_Store();
return $store;
}
if ( isset( $GLOBALS['wp_secrets_store'] ) && $GLOBALS['wp_secrets_store'] instanceof WP_Secrets_Store ) {
$store = $GLOBALS['wp_secrets_store'];
return $store;
}
$store = new WP_Secrets_Option_Store();
return $store;
}