[wp-trac] [WordPress Trac] #3368: $wp_query->max_num_pages needs to be ceil()'d

WordPress Trac noreply at wordpress.org
Mon Feb 12 04:35:11 UTC 2024


#3368: $wp_query->max_num_pages needs to be ceil()'d
--------------------------+---------------------
 Reporter:  MattRead      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Template      |     Version:  2.1
 Severity:  normal        |  Resolution:  fixed
 Keywords:                |     Focuses:
--------------------------+---------------------

Comment (by judovan6):

 Are you suggesting that `$wp_query->max_num_pages` should be rounded up
 using the `ceil()` function to ensure accurate paging links, especially
 when dealing with fractional values like 1.6? This adjustment, as proposed
 in your diff for query.php, aims to prevent inconsistencies in paging
 links generated by functions like `next_posts_link()`. Would you like to
 proceed with implementing this change to improve the accuracy of paging
 navigation?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/3368#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list