File: /home/h278792/www/wp-content/themes/ecademy-child/functions.php
<?php
/**
* Add new currency
*
* @param $currencies
*
* @return mixed
*/
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
add_filter( 'wpems_currencies', 'thim_custom_curency' );
function thim_new_event_currency_symbol( $currency_symbol, $currency ) {
if ( $currency == 'IR' ) {
$currency_symbol = 'تومان';
}
return $currency_symbol;
}
add_filter( 'tp_event_currency_symbol', 'thim_new_event_currency_symbol', 10, 2 );
function my_cbf_learn_press_get_payment_currencies( $currencies ){
$currency_new = 'IR'; # Currency Code
$currency_name = __('تومان', '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 = 'IR'; # Currency Code
if( $currency == $currency_new ) {
$currency_symbol = 'تومان'; # Symbol of currency
}
return $currency_symbol;
}
function thim_custom_curency($currencies){
$currencies['IR'] = 'تومان';
return $currencies;
}
function iptrtl_add_stylesheet() {
$template_dir_uri = get_template_directory_uri();
$template_dir = get_template_directory();
//$stylesheet_dir = get_stylesheet_directory();
if ( file_exists("$template_dir/rtl.css") ) {
wp_register_style( 'parent-theme-rtl', "$template_dir_uri/rtl.css" );
wp_enqueue_style( 'parent-theme-rtl' );
}
}
add_action('wp_print_styles', 'iptrtl_add_stylesheet');
function ecademy_enqueue_style() {
wp_enqueue_style( "parent-style" , get_parent_theme_file_uri( "/style.css" ) );
}
add_action( 'wp_enqueue_scripts', 'ecademy_enqueue_style' );