' . __('Settings', 'accept-coin') . '',); return array_merge($plugin_links, $links); } add_action('wp_head', 'wc_clear_cart'); function wc_clear_cart() { $acceptcoinOrderPlaced = WC()->session->get('acceptcoinOrderPlaced'); if (wc_get_page_id('cart') == get_the_ID() || wc_get_page_id('checkout') == get_the_ID() || !$acceptcoinOrderPlaced) { return; } WC()->session->set('acceptcoinOrderPlaced', null); WC()->cart->empty_cart(); } add_action('phpmailer_init', 'acc_mailing_data'); /** * @param $phpmailer * @return void */ function acc_mailing_data($phpmailer): void { $accOptions = get_option('woocommerce_acceptcoin_settings'); $phpmailer->isSMTP(); $phpmailer->SMTPAuth = true; $phpmailer->Host = get_option('smtp_host') ? get_option('smtp_host') : $accOptions['smtp_host']; $phpmailer->Port = get_option('smtp_port') ? get_option('smtp_port') : $accOptions['smtp_port']; $phpmailer->Username = get_option('smtp_username') ? get_option('smtp_username') : $accOptions['smtp_username']; $phpmailer->Password = get_option('smtp_password') ? get_option('smtp_password') : $accOptions['smtp_password']; $phpmailer->SMTPSecure = get_option('smtp_encryption') ?? $accOptions['smtp_encryption']; } }