wpseek.com
A WordPress-centric search engine for devs and theme authors
_wp_secrets_get_store › WordPress Function
Since7.2.0
Deprecatedn/a
› _wp_secrets_get_store ( No parameters )
| Returns: |
|
| Defined at: |
|
| Codex: |
Returns the active secret store.
No filter is applied here, or anywhere on the retrieval path. See docs/spec/extension-points.md. 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
Source
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;
}