LLMS_Payment_Gateway::get_option( string $key, string $secure_key = false )

Get the value of an option from the database & fallback to default value if none found

Description Description

Optionally attempts to retrieve a secure key first, if secure key is provided.

The behavior of this function differs slightly from the parent method in that the second argument in this method allows lookup of the secure key value.

Default options are autoloaded via the get_option_default_value() method.

Top ↑

Parameters Parameters


(string) (Required) option Option name / key, eg: "title".


(string) (Optional) Secure option name / key, eg: "TITLE".

Default value: false

Top ↑

Return Return


Top ↑

Source Source

File: includes/abstracts/abstract.llms.payment.gateway.php

	public function get_option( $key, $secure_key = false ) {

		if ( $secure_key ) {
			$secure_val = llms_get_secure_option( $secure_key );
			if ( false !== $secure_val ) {
				return $secure_val; // Intentionally not filtered here.

		$val = parent::get_option( $key );

		 * Filters the value of a gateway option
		 * The dynamic portion of the hook, `{$key}`, refers to the unprefixed
		 * option name.
		 * @since Unknown
		 * @param mixed  $val        Option value.
		 * @param string $gateway_id Payment gateway ID.
		return apply_filters( "llms_get_gateway_{$key}", $val, $this->id );


Top ↑

Changelog Changelog

Version Description
3.29.0 Added secure option lookup via option second parameter.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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