Plugin Settings Page Updates Using Constants

- Ensures that any available defined constants are loaded in place of
  any database stored settings as an override.
isekai
Tim Nolte 4 years ago
parent ecaa06bac2
commit 93cd5d0cc2
No known key found for this signature in database
GPG Key ID: 33E7CA1AD448F3B3

@ -110,6 +110,13 @@ class OpenID_Connect_Generic_Option_Settings {
$this->values = (array) get_option( $this->option_name, $this->default_settings );
}
// For each defined environment variable/constant be sure the settings key is set.
foreach ( $this->environment_settings as $key => $constant ) {
if ( defined( $constant ) ) {
$this->__set( $key, constant( $constant ) );
}
}
if ( $granular_defaults ) {
$this->values = array_replace_recursive( $this->default_settings, $this->values );
}

Loading…
Cancel
Save