Skip to content

Commit

Permalink
Update: Unwanted code removed, logics updated
Browse files Browse the repository at this point in the history
  • Loading branch information
shewa12 committed Jan 11, 2024
1 parent 9a4e5e9 commit 0677c49
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions includes/tutor-general-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1222,9 +1222,11 @@ function tutor_entry_box_buttons( int $course_id = 0, int $user_id = 0 ) {
$is_completed_course = tutor_utils()->is_completed_course( $course_id, $user_id );
$course_progress = (int) tutor_utils()->get_course_completed_percent( $course_id, $user_id );

if ( $course_progress > 0 ) {
if ( $course_progress > 0 || $course_progress < 100) {
$conditional_buttons->show_continue_learning_btn = true;
} else {
}

if ( $course_progress === 0 ) {
$conditional_buttons->show_start_learning_btn = true;
}

Expand Down Expand Up @@ -1259,8 +1261,3 @@ function tutor_entry_box_buttons( int $course_id = 0, int $user_id = 0 ) {
return apply_filters( 'tutor_enrollment_buttons', $conditional_buttons );
}
}


add_action( 'template_redirect' , function(){
tutor_entry_box_buttons();
});

0 comments on commit 0677c49

Please sign in to comment.