$html .= '<section class="' . esc_attr(implode(' ', $classes)) . '">'; $html .= '<button class="llms-h3 llms-section-title toggle">'; $html .= '<h3>'; $html .= '<i class="fa fa-check-square" aria-hidden="true"></i>'; $html .= $section->post->post_title; $html .= '<i class="fa fa-caret-down" aria-hidden="true"></i>'; $html .= '</h3>'; $html .= '</button>'; //get lesson data $lessons = $section->get_children_lessons(); if (!$lessons) { $html .= LLMS_Language::output('This section does not have any lessons.'); } else { $html .= '<div class="lessons">'; foreach ($lessons as $lesson_child) { $lesson = new LLMS_Lesson($lesson_child->ID); //determine if lesson is complete to show complete icon if ($lesson->is_complete()) { $check = '<span class="llms-lesson-complete"><i class="fa fa-check-circle"></i></span>'; $complete = ' is-complete'; } else { $complete = $check = ''; } //set permalink $permalink = 'javascript:void(0)'; $page_restricted = llms_page_restricted($course->id); $title = ''; $linkclass = ''; if (!$page_restricted['is_restricted']) { $permalink = get_permalink($lesson->id); $linkclass = 'llms-lesson-link';
<?php /** * @author codeBOX * @package lifterLMS/Templates */ if (!defined('ABSPATH')) { exit; } global $post, $lesson; if (!$lesson) { $lesson = new LLMS_Lesson($post->ID); } $user = new LLMS_Person(); $user_postmetas = $user->get_user_postmeta_data(get_current_user_id(), $lesson->id); //get associated quiz $associated_quiz = get_post_meta($post->ID, '_llms_assigned_quiz', true); ?> <div class="clear"></div> <div class="llms-lesson-button-wrapper iceberg"> <?php if (isset($user_postmetas['_is_complete'])) { if ($user_postmetas['_is_complete']->meta_value === 'yes') { if ($associated_quiz) { echo '<em>' . __('You\'ve already completed this quiz.', 'yoastcom') . '</em>'; } else { echo '<em>' . __('You\'ve already completed this lesson.', 'yoastcom') . '</em>'; } } }