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


Top ↑

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: ''


Top ↑

Return Return

(mixed)


Top ↑

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;

}


Top ↑

Changelog Changelog

Changelog
Version Description
3.29.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.