Thứ Ba, 13 tháng 3, 2018

How to add new currency to LearnPress




To add new currency to LearnPress, you need add bellow code to functions.php file in your WordPress theme

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
# add currency in to LearnPress 
add_filter('learn_press_get_payment_currencies', 'my_cbf_learn_press_get_payment_currencies', 10, 1 ); // for LearnPress 2
add_filter('learn-press/currencies''my_cbf_learn_press_get_payment_currencies', 10, 1 ); // for LearnPress 3
function my_cbf_learn_press_get_payment_currencies( $currencies ){
    $currency_new = 'MCR'; # Currency Code
    $currency_name = __('My Currency (MCR)', 'learnpress'); # Full name of Currency    
    if( !isset($currencies[$currency_new]) || ( isset($currencies[$currency_new]) && $currencies[$currency_new] !== $currency_name ) ) {
        $currencies[$currency_new] = $currency_name;
    }
    return $currencies;
}
add_filter( 'learn_press_currency_symbol', 'my_cbf_learn_press_currency_symbol', 10, 2 );
function my_cbf_learn_press_currency_symbol( $currency_symbol, $currency ) {
    $currency_new = 'MCR'; # Currency Code
    if( $currency == $currency_new ) {
        $currency_symbol = '<i class="fa fa-thumbs-up"></i>'; # Symbol of currency
    }
    return $currency_symbol;
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Results:



Không có nhận xét nào:

Đăng nhận xét

How to disable alt + mouse click actions in JWM

In Puppy Linux , you can move windows by use Alt key with Right mouse click . Sometimes it's quite convenient, but it conflict with key...