[wp-trac] [WordPress Trac] #24142: Zero value for posts_per_page value in wp_query custom instance and for 'Blog pages show at most' option

WordPress Trac noreply at wordpress.org
Mon Aug 12 23:52:24 UTC 2013


#24142: Zero value for posts_per_page value in wp_query custom instance and for
'Blog pages show at most' option
--------------------------+----------------------
 Reporter:  alexvorn2     |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Query         |     Version:
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |
--------------------------+----------------------

Comment (by DrewAPicture):

 A more valid use case for this might be if you're passing the
 `post_per_page` value through `absint()` or similar and zero gets
 returned.

 I can follow the logic of -1 = unlimited, or 1 = 1, 2 = 2 and so on. So
 it's odd that we say, "Oh, by the way, 0 doesn't equal 0 here, it actually
 equals this other thing over there."

 It kind of stands to reason that if I pass 0 I'd expect to get 0 results,
 intentional or not. Just sayin'.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24142#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list