[wp-trac] [WordPress Trac] #19773: query.php paging block clarity

WordPress Trac wp-trac at lists.automattic.com
Sat Jan 7 22:59:56 UTC 2012


#19773: query.php paging block clarity
--------------------------+-----------------------------
 Reporter:  kawauso       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:  3.3
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 A few simple changes to the `// Paging` block in wp-includes/query.php

 * `$page` is being checked with `empty()`, but is already passed through
 `absint()` which can only return an integer. Just using `!` makes it a bit
 less confusing.

 * `$pgstrt = '';` is redundant as it's overwritten on the following line

 * `$limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];` is repeated, so
 moved outside the if/else block for readability.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19773>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list