Skip to content

Instantly share code, notes, and snippets.

@thomasplevy
Created October 11, 2016 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasplevy/554fd5a23aa4f1805ba5ac1fba039650 to your computer and use it in GitHub Desktop.
Save thomasplevy/554fd5a23aa4f1805ba5ac1fba039650 to your computer and use it in GitHub Desktop.
<?php // don't add this line to your functions.php file
/**
* Add a custom currency to LifterLMS
* Our custom currency code for this example is "VFC"
* We'll call the currency "Very Fancy Coins"
* And use an "@" symbol for the currency symbol (because it could resemble a very fancy coin if you look at it right)
*/
/**
* Add a custom currency to LifterLMS
* @param array $currencies existing currencies
* @return array
*/
function my_custom_currency( $currencies ) {
$currencies['VFC'] = __( 'Very Fancy Coins', 'my-domain' );
return $currencies;
}
add_filter( 'lifterlms_currencies', 'my_custom_currency' );
/**
* Add a Custom Currency Symbol for the new custom currency
* @param array $currencies existing currency symbols
* @return array
*/
function my_custom_currency_symbol( $currencies ) {
$currencies['VFC'] = '@';
return $currencies;
}
add_filter( 'lifterlms_currency_symbols', 'my_custom_currency_symbol' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment