Skip to content

Commit

Permalink
🩹 Fix the comment list output (#3184)
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x authored Feb 2, 2024
1 parent a86946e commit 308cc20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions app/View/Composers/Comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function with()
{
return [
'title' => $this->title(),
'comments' => $this->comments(),
'responses' => $this->responses(),
'previous' => $this->previous(),
'next' => $this->next(),
'paginated' => $this->paginated(),
Expand All @@ -43,7 +43,7 @@ public function title()
/* translators: %1$s is replaced with the number of comments and %2$s with the post title */
_nx('%1$s response to “%2$s”', '%1$s responses to “%2$s”', get_comments_number(), 'comments title', 'sage'),
get_comments_number() === 1 ? _x('One', 'comments title', 'sage') : number_format_i18n(get_comments_number()),
'<span>'.get_the_title().'</span>'
get_the_title()
);
}

Expand All @@ -52,7 +52,7 @@ public function title()
*
* @return string
*/
public function comments()
public function responses()
{
if (! have_comments()) {
return;
Expand All @@ -61,6 +61,7 @@ public function comments()
return wp_list_comments([
'style' => 'ol',
'short_ping' => true,
'echo' => false,
]);
}

Expand Down
4 changes: 2 additions & 2 deletions resources/views/partials/comments.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@if (! post_password_required())
<section id="comments" class="comments">
@if ($comments)
@if ($responses)
<h2>
{!! $title !!}
</h2>

<ol class="comment-list">
@php($comments)
{!! $responses !!}
</ol>

@if ($paginated)
Expand Down

0 comments on commit 308cc20

Please sign in to comment.