Skip to content

Commit

Permalink
Fix Continue Course block not redirecting to first lesson when only o…
Browse files Browse the repository at this point in the history
…ne lesson
  • Loading branch information
m1r0 committed Jun 29, 2023
1 parent dba5a5d commit 3535ce8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/class-sensei-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -2786,7 +2786,7 @@ public static function get_target_page_post_id_for_continue_url( $course_id, $us
$completed_lessons = Sensei()->course->get_completed_lesson_ids( $course_id, $user_id );
$not_completed_lessons = array_diff( $course_lessons, $completed_lessons );

if ( count( $course_lessons ) !== count( $not_completed_lessons ) && ! empty( $not_completed_lessons ) ) {
if ( $not_completed_lessons ) {
return current( $not_completed_lessons );
}
}
Expand Down

0 comments on commit 3535ce8

Please sign in to comment.