🎨 Move comment logic into a dedicated Composer (#3162)

* 🎨 Move comment logic into a dedicated Composer

* 🎨 Swap the method order
This commit is contained in:
Brandon
2024-01-18 12:37:47 -06:00
committed by GitHub
parent ad93e8b8c7
commit c72f14c68d
2 changed files with 127 additions and 9 deletions

View File

@@ -1,26 +1,26 @@
@if (! post_password_required())
<section id="comments" class="comments">
@if (have_comments())
@if ($comments)
<h2>
{!! /* translators: %1$s is replaced with the number of comments and %2$s with the post title */ sprintf(_nx('%1$s response to &ldquo;%2$s&rdquo;', '%1$s responses to &ldquo;%2$s&rdquo;', 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>') !!}
{!! $title !!}
</h2>
<ol class="comment-list">
{!! wp_list_comments(['style' => 'ol', 'short_ping' => true]) !!}
{!! $comments !!}
</ol>
@if (get_comment_pages_count() > 1 && get_option('page_comments'))
@if ($paginated)
<nav>
<ul class="pager">
@if (get_previous_comments_link())
@if ($previous)
<li class="previous">
{!! get_previous_comments_link(__('&larr; Older comments', 'sage')) !!}
{!! $previous !!}
</li>
@endif
@if (get_next_comments_link())
@if ($next)
<li class="next">
{!! get_next_comments_link(__('Newer comments &rarr;', 'sage')) !!}
{!! $next !!}
</li>
@endif
</ul>
@@ -28,7 +28,7 @@
@endif
@endif
@if (! comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments'))
@if ($closed)
<x-alert type="warning">
{!! __('Comments are closed.', 'sage') !!}
</x-alert>