post_type; $aelms_allowed_post_type = [ acadlix()->cpt()->course()->get_post_type(), ]; if (acadlix()->helper()->is_course_bundle_addon_active()) { $aelms_allowed_post_type[] = acadlix()->cpt()->course_bundle()->get_post_type(); } $type = 'course'; if (in_array($post_type, $aelms_allowed_post_type, true)) { if ($post_type == acadlix()->cpt()->course()->get_post_type()) { $aelms_item = acadlix()->model()->course()->ofCourse()->find($post->ID); $type = 'course'; } else if ($post_type == acadlix()->cpt()->course_bundle()->get_post_type()) { $aelms_item = acadlix()->model()->courseBundle()->ofCourseBundle()->find($post->ID); $type = 'course-bundle'; } if ($aelms_item) { $aelms_title_tag = $settings['course_faq_html_tag']; $aelms_title = $settings['course_faq_title'] ?? ''; $aelms_display_title = $settings['course_faq_title_display'] === "yes" ? true : false; $aelms_faqs = $aelms_item->rendered_metas['faqs'] ?? []; $aelms_valid_faqs = array_filter($aelms_faqs, function ($faq) { return !empty(trim($faq['question'] ?? '')); // trim handles whitespace-only strings }); ?> ' . esc_html($aelms_title) . ' ', esc_attr($aelms_title_tag) ); } if (isset($aelms_valid_faqs) && count($aelms_valid_faqs) > 0) { ?>
$aelms_faq) { $aelms_question = $aelms_faq['question'] ?? ''; $aelms_answer = $aelms_faq['answer'] ?? ''; $aelms_toggle_id = 'aelms-faq-toggle-' . esc_attr($index); ?>
>