Created
October 11, 2016 23:52
-
-
Save thomasplevy/554fd5a23aa4f1805ba5ac1fba039650 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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