Skip to content
Docs
Get RestroPress

Filter

rpress_get_option_{$key}

Updated
On this page

Filters the value returned by rpress_get_option() for one specific setting key.

Runs after the general rpress_get_option filter, with the option key in the hook name. Use it to override a single setting without testing the key yourself.

Parameters#

ParameterTypeDescription
$valuemixedThe option value after the general filter.
$keystringThe option key.
$defaultmixedThe default passed to rpress_get_option().

Return value#

mixed. The option value.

Example#

function my_currency_option( $value, $key, $default ) {
	return 'USD';
}
add_filter( 'rpress_get_option_currency', 'my_currency_option', 10, 3 );

Source#

Applied in:

  • includes/admin/settings/register-settings.php (line 28), in rpress_get_option()

See also#

Was this page helpful?