Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/wp-includes/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,10 @@ function wp_using_ext_object_cache( $using = null ) {
* Runs once, before must-use plugins load, so that every interface a drop-in's
* classes implement already exists and every plugin sees the drop-in's provider.
*
* The drop-in sets its overrides in the `$wp_secrets_provider`, `$wp_secrets_store`
* and `$wp_secrets_keyring` globals. They are declared global before the require, so
* a plain assignment such as `$wp_secrets_keyring = new My_Keyring();` works.
*
* Sets `$GLOBALS['wp_secrets_dropin_loaded']` as soon as the file is found, whether
* or not it then loads cleanly: wp_using_secrets_dropin() reports presence, not
* health.
Expand Down Expand Up @@ -873,6 +877,12 @@ function wp_load_secrets_dropin(): void {

$GLOBALS['wp_secrets_dropin_loaded'] = true;

/*
* The drop-in is required inside this function. Declaring the overrides global
* lets it set them as plain variables, as db.php does with $wpdb.
*/
global $wp_secrets_provider, $wp_secrets_store, $wp_secrets_keyring;

try {
require $dropin_path;
} catch ( Throwable $e ) {
Expand Down
Loading