/**
  * Display course status message
  */
 function learn_press_course_status_message()
 {
     _deprecated_function(__FUNCTION__, '1.0', need_to_updating());
     learn_press_get_template('single-course/course-pending.php');
 }
 /**
  * Course payment form
  */
 function learn_press_course_payment_form()
 {
     _deprecated_function(__FUNCTION__, '1.0', need_to_updating());
     learn_press_get_template('single-course/payment-form.php');
 }
Ejemplo n.º 3
0
/**
 * Checks to see that an user has finished a lesson or not yet
 * Function return the ID of a course if the user has completed a lesson
 * Otherwise, return false
 *
 * @author TuNguyen
 *
 * @param null $lesson_id
 * @param null $user_id
 *
 * @return mixed
 */
function learn_press_user_has_completed_lesson($lesson_id = null, $user_id = null)
{
    _deprecated_function(__FUNCTION__, '1.0', need_to_updating());
    $lesson_id = learn_press_get_lesson_id($lesson_id);
    if (!$user_id) {
        $user_id = get_current_user_id();
    }
    $completed_lessons = get_user_meta($user_id, '_lpr_lesson_completed', true);
    if (!$completed_lessons) {
        return false;
    }
    foreach ($completed_lessons as $courses) {
        if (is_array($courses) && in_array($lesson_id, $courses)) {
            return true;
        }
    }
    return false;
}