Make WordPress Core

Opened 7 months ago

#59625 new defect (bug)

Pagination. Classes name mistake for item of pagination

Reported by: blackstar1991's profile blackstar1991 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.3
Component: General Keywords:
Focuses: css, performance Cc:

Description

If you created pagination for comments using the default method. For example

<?php
<?php

$args = array(
    'post_id' => get_the_ID(), 
    'parent' => 0, 
    'count' => true, 
);
$top_level_comments_count = get_comments($args);
$max_pages = ceil($top_level_comments_count / $per_page);

$args = array(
    'screen_reader_text' => __('Comments navigation'),
    'aria_label' => __('Comments'),
    'class' => 'comments-pagination',
    'format' => '',
    'total' => $max_pages,
    'current' => $page,
    'prev_text' => '❮',
    'next_text' => '❯',
    'type' => 'list',
    'echo' => false, // Установите это значение в false
);

$pagination = get_the_comments_pagination($args);
$pagination = str_replace('#comments', '', $pagination);
?>
<div class="company-rewiew-pagination">
    <?php echo $pagination; ?>
</div>

This challenge created this pagination for me

<?php
<div class="company-rewiew-pagination">
  <nav class="navigation comments-pagination" aria-label="Comments">
    <h2 class="screen-reader-text">Comments navigation</h2>
    <div class="nav-links">
      <ul class="page-numbers">
        <li><span aria-current="page" class="page-numbers current">1</span></li>
        <li><a class="page-numbers" href="https://test.local/review/test-company-1/comment-page-2/">2</a></li>
        <li><a class="page-numbers" href="https://test.local/review/test-company-1/comment-page-3/">3</a></li>
        <li><a class="next page-numbers" href="https://test.local/review/test-company-1/comment-page-2/"></a></li>
      </ul>
    </div>
  </nav>
</div>

But I got a bug into name of <ul> class wrapper. It has the same class like for <li><a class="page-numbers"> item. class="page-numbers" Can You fix this mistake ? Can you make for item <li><a class="page-number"> name?
https://i.ibb.co/VCnFZyc/Corrected.jpg

<ul class="page-numbers"> and <li><a class="... page-numbers"> has different logics for CSS styles but has the same name of classes. Can you fix it?

Change History (0)

Note: See TracTickets for help on using tickets.