[wp-trac] [WordPress Trac] #59625: Pagination. Classes name mistake for item of pagination

WordPress Trac noreply at wordpress.org
Sat Oct 14 14:12:27 UTC 2023


#59625: Pagination. Classes name mistake for item of pagination
------------------------------+-----------------------------
 Reporter:  blackstar1991     |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  General           |    Version:  6.3
 Severity:  normal            |   Keywords:
  Focuses:  css, performance  |
------------------------------+-----------------------------
 If you created pagination for comments using the default method. For
 example
 {{{#!php
 <?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
 <?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?
 [[Image(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?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59625>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list