is_license_active(); $is_pro = class_exists('ACCEVE_Academic_Certificate_Verification_Pro'); $plugin_options = get_option('acceve_certificate_verification_options', array()); $certificate_templates = array(); if ($is_pro) { global $wpdb; $templates_table = $wpdb->prefix . 'acceve_certificate_templates'; // phpcs:ignore if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $templates_table)) === $templates_table) {$certificate_templates = $wpdb->get_results("SELECT id, template_name FROM {$templates_table} ORDER BY template_name ASC", ARRAY_A);} } // Check if editing // phpcs:ignore WordPress.Security.NonceVerification.Recommended if (isset($_GET['action']) && $_GET['action'] === 'edit' && isset($_GET['course_id'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $course_id = sanitize_text_field(wp_unslash($_GET['course_id'])); if (isset($courses[$course_id])) { $edit_course = $courses[$course_id]; $edit_course['id'] = $course_id; } } $course_cert_template = 'inherit'; $course_cert_custom = ''; if (isset($edit_course)) { if (!empty($edit_course['certificate_template'])) { $course_cert_template = $edit_course['certificate_template']; } if (isset($edit_course['certificate_custom_template']) && $edit_course['certificate_custom_template'] !== '') { $course_cert_custom = (string) $edit_course['certificate_custom_template']; } } ?>