llms_get_secure_option( string $secure_name, mixed $default = false, string $db_name = '' )
Retrieve a “secure” option.
Description Description
Checks environment variables and then constant definitions
Parameters Parameters
- $secure_name
-
(string) (Required) Name of the option variable / constant.
- $default
-
(mixed) (Optional) default value used as a fallback.
Default value: false
- $db_name
-
(string) (Optional) option name to fallback on if no constant or environment var is found.
Default value: ''
Return Return
(mixed)
Source Source
File: includes/functions/llms-functions-options.php
function llms_get_secure_option( $secure_name, $default = false, $db_name = '' ) {
// Try an environment variable first.
$val = getenv( $secure_name );
if ( false !== $val ) {
return $val;
}
// Try a constant.
if ( defined( $secure_name ) ) {
return constant( $secure_name );
}
if ( $db_name ) {
return get_option( $db_name, $default );
}
// Return the default value.
return $default;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.29.0 | Introduced. |