function kerim_alp_get_user_course_ids_from_orders($user_id = 0) { if (!$user_id || !function_exists('wc_get_orders')) return []; $orders = wc_get_orders([ 'customer_id' => $user_id, 'status' => ['completed','processing','on-hold'], 'limit' => -1, ]); if (!$orders) return []; $product_ids = []; foreach ($orders as $order) { foreach ($order->get_items() as $item) { $product_ids[] = $item->get_product_id(); } } $product_ids = array_unique(array_filter($product_ids)); if (!$product_ids) return []; $courses = get_posts([ 'post_type' => 'ka_course', 'numberposts' => -1, 'post_status' => 'publish', 'meta_query' => [[ 'key' => '_ka_course_product_id', 'value' => $product_ids, 'compare' => 'IN', ]] ]); return $courses ?: []; } function kerim_alp_wc_thankyou_redirect($order_id) { if (!$order_id || is_admin()) return; $redirect = kerim_alp_get_option('post_purchase_redirect', home_url('/panelim/')); if ($redirect) { $redirect = add_query_arg('ka_purchase', 'success', $redirect); wp_safe_redirect($redirect); exit; } } add_action('woocommerce_thankyou', 'kerim_alp_wc_thankyou_redirect', 20); function kerim_alp_payment_success_notice() { if (!is_user_logged_in()) return; if (empty($_GET['ka_purchase']) || $_GET['ka_purchase'] !== 'success') return; $text = kerim_alp_get_option('welcome_notice_text', 'Satın alma başarılı. Eğitim paneline hoş geldin.'); echo '
' . esc_html($text) . '
'; } add_action('wp_footer', 'kerim_alp_payment_success_notice'); function kerim_alp_append_order_email_text($order, $sent_to_admin, $plain_text, $email) { if ($sent_to_admin || !$order instanceof WC_Order) return; $panel = home_url('/panelim/'); $courses = home_url('/egitimler/'); $title = kerim_alp_get_option('mail_cta_title', 'Eğitimine Erişim Hazır'); $text = kerim_alp_get_option('mail_cta_text', 'Satın aldığın eğitime panelinden hemen erişebilirsin.'); if ($plain_text) { echo "\n" . wp_strip_all_tags($title) . "\n"; echo wp_strip_all_tags($text) . "\n"; echo 'Panel: ' . esc_url($panel) . "\n"; echo 'Eğitimler: ' . esc_url($courses) . "\n"; return; } echo '
'; echo '

' . esc_html($title) . '

'; echo '

' . esc_html($text) . '

'; echo '

Panelime Git

'; echo '

Eğitimleri Aç

'; echo '
'; } if (function_exists('add_action')) { add_action('woocommerce_email_after_order_table', 'kerim_alp_append_order_email_text', 20, 4); } function kerim_alp_user_has_course_access($course_id) { if (!is_user_logged_in()) return false; $product_id = (int) get_post_meta($course_id, '_ka_course_product_id', true); if (!$product_id) return true; if (function_exists('wc_customer_bought_product')) { $user = wp_get_current_user(); if (wc_customer_bought_product($user->user_email, $user->ID, $product_id)) { return true; } } return false; } Sample Page – Kerim Alp Tütüncü
SAYFA

Sample Page

This is an example page. It’s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:

Hi there! I’m a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin’ caught in the rain.)

…or something like this:

The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.

As a new WordPress user, you should go to your dashboard to delete this page and create new pages for your content. Have fun!

Ücretsiz Analiz İçin Yaz