Skip to content

Commit

Permalink
Merge pull request #7063 from Automattic/fix/extra-heading-fix-course…
Browse files Browse the repository at this point in the history
…-and-lesson

Fix extra empty header element echoing in course and lesson
  • Loading branch information
donnapep authored Aug 17, 2023
2 parents 6b4a964 + 274f15d commit db7f89c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-extra-heading-fix-course-and-lesson
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fixed extra header element in lesson content
10 changes: 8 additions & 2 deletions includes/class-sensei-lesson.php
Original file line number Diff line number Diff line change
Expand Up @@ -4869,14 +4869,20 @@ public static function the_title() {
&& Sensei_Utils::is_preview_lesson( $post->ID )
&& ! Sensei_Course::is_user_enrolled( $course_id, $current_user->ID );

/** This filter is documented in includes/class-sensei-messages.php */
$title = apply_filters( 'sensei_single_title', get_the_title( $post ), $post->post_type );

if ( ! $title ) {
return;
}

?>
<header class="lesson-title">

<h1>

<?php
/** This filter is documented in includes/class-sensei-messages.php */
echo wp_kses_post( apply_filters( 'sensei_single_title', get_the_title( $post ), $post->post_type ) );
echo wp_kses_post( $title );
?>

</h1>
Expand Down

0 comments on commit db7f89c

Please sign in to comment.