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.
Parameters Parameters
- $key
-
(string) (Required) option Option name / key, eg: "title".
- $secure_key
-
(string) (Optional) Secure option name / key, eg: "TITLE".
Default value: false
Return Return
(mixed)
Source Source
File: includes/abstracts/abstract.llms.payment.gateway.php
919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 | 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 ); } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.29.0 | Added secure option lookup via option second parameter. |
3.0.0 | Introduced. |