Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/php-deprecations-and-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
donnapep committed Aug 19, 2024
2 parents 36cdf95 + 9886da6 commit 4e03e26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-missing-lesson-status-icon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix missing lesson status icon for "complete" status
11 changes: 6 additions & 5 deletions includes/blocks/course-theme/class-course-navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Course_Navigation {
'not-started' => 'circle',
'in-progress' => 'half-filled-circle',
'ungraded' => 'half-filled-circle',
'complete' => 'check-filled-circle',
'completed' => 'check-filled-circle',
'failed' => 'half-filled-circle',
'locked' => 'lock',
Expand Down Expand Up @@ -95,7 +96,7 @@ public function render_course_navigation() {
$modules_html = implode(
'',
array_map(
function( $item ) {
function ( $item ) {
if ( 'module' === $item['type'] ) {
return $this->render_module( $item );
}
Expand All @@ -108,7 +109,7 @@ function( $item ) {
$lessons_html = implode(
'',
array_map(
function( $item ) {
function ( $item ) {
if ( 'lesson' === $item['type'] ) {
return $this->render_lesson( $item );
}
Expand Down Expand Up @@ -164,7 +165,7 @@ private function render_module( $module ) {
$lessons_html = implode(
'',
array_map(
function( $lesson ) {
function ( $lesson ) {
return $this->render_lesson( $lesson );
},
$lessons
Expand All @@ -175,7 +176,7 @@ function( $lesson ) {
$has_current_lesson = count(
array_filter(
$lessons,
function( $lesson ) use ( $current_lesson_id ) {
function ( $lesson ) use ( $current_lesson_id ) {
return $current_lesson_id === $lesson['id'];
}
)
Expand All @@ -186,7 +187,7 @@ function( $lesson ) use ( $current_lesson_id ) {
$quiz_count = count(
array_filter(
$lessons,
function( $lesson ) {
function ( $lesson ) {
return \Sensei_Lesson::lesson_quiz_has_questions( $lesson['id'] );
}
)
Expand Down

0 comments on commit 4e03e26

Please sign in to comment.