Filter
rpress_core_stripe_secret_key
On this page
Filters the Stripe secret key used by the core Stripe gateway.
Runs in rpress_core_stripe_get_secret_key. The value is the test or live secret key from the gateway settings depending on whether test mode is on, and the filtered result is cast to string and trimmed. Use it to load the key from a constant or environment instead of the database.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$key | string | Secret key for the current mode, or an empty string. |
Return value#
string. The secret key to use.
Example#
function my_stripe_secret_key( $key ) {
if ( defined( 'MY_STRIPE_SECRET_KEY' ) ) {
return MY_STRIPE_SECRET_KEY;
}
return $key;
}
add_filter( 'rpress_core_stripe_secret_key', 'my_stripe_secret_key' );
Source#
Applied in:
includes/gateways/stripe.php(line 293), inrpress_core_stripe_get_secret_key()
See also#
Was this page helpful?
