| Server IP : 172.67.134.116 / Your IP : 216.73.217.68 Web Server : Apache System : Linux server.rehabsharif.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : nobi37te ( 1003) PHP Version : 8.2.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/nobi37te/public_html/wp-content/plugins/woocommerce-multi-currency/plugins/ |
Upload File : |
<?php
/**
* Class WOOMULTI_CURRENCY_Plugin_WPML
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class WOOMULTI_CURRENCY_Plugin_WPML {
protected $settings;
public function __construct() {
if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) {
$this->settings = WOOMULTI_CURRENCY_Data::get_ins();
if ( $this->settings->get_enable() ) {
add_action( 'init', array( $this, 'init' ), 99 );
}
}
}
/**
*
*/
public function init() {
if ( $this->settings->enable_wpml() ) {
$current_lang = wpml_get_current_language();
$current_currency = $this->settings->get_current_currency();
$depend_currency = $this->settings->get_wpml_currency_by_language( $current_lang );
$check_lang = $this->settings->getcookie( 'wmc_wpml_lang' );
if ( $check_lang != $current_lang ) {
$this->settings->setcookie( 'wmc_wpml_lang', $current_lang, time() + 86400 );
if ( $depend_currency != $current_currency ) {
$this->settings->set_current_currency( $depend_currency );
}
}
}
}
}