Skip to content

Commit 308cc20

Browse files
authored
🩹 Fix the comment list output (#3184)
1 parent a86946e commit 308cc20

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/View/Composers/Comments.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function with()
2424
{
2525
return [
2626
'title' => $this->title(),
27-
'comments' => $this->comments(),
27+
'responses' => $this->responses(),
2828
'previous' => $this->previous(),
2929
'next' => $this->next(),
3030
'paginated' => $this->paginated(),
@@ -43,7 +43,7 @@ public function title()
4343
/* translators: %1$s is replaced with the number of comments and %2$s with the post title */
4444
_nx('%1$s response to “%2$s”', '%1$s responses to “%2$s”', get_comments_number(), 'comments title', 'sage'),
4545
get_comments_number() === 1 ? _x('One', 'comments title', 'sage') : number_format_i18n(get_comments_number()),
46-
'<span>'.get_the_title().'</span>'
46+
get_the_title()
4747
);
4848
}
4949

@@ -52,7 +52,7 @@ public function title()
5252
*
5353
* @return string
5454
*/
55-
public function comments()
55+
public function responses()
5656
{
5757
if (! have_comments()) {
5858
return;
@@ -61,6 +61,7 @@ public function comments()
6161
return wp_list_comments([
6262
'style' => 'ol',
6363
'short_ping' => true,
64+
'echo' => false,
6465
]);
6566
}
6667

resources/views/partials/comments.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
@if (! post_password_required())
22
<section id="comments" class="comments">
3-
@if ($comments)
3+
@if ($responses)
44
<h2>
55
{!! $title !!}
66
</h2>
77

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

1212
@if ($paginated)

0 commit comments

Comments
 (0)