[wp-trac] [WordPress Trac] #42469: WP_Query found_posts inconsistent data type.

WordPress Trac noreply at wordpress.org
Thu Nov 9 14:52:29 UTC 2017


#42469: WP_Query found_posts inconsistent data type.
--------------------------+------------------------------
 Reporter:  PressLabs     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by PressLabs):

 I'm unsure what the stance is on the matter, but do you in core enforce
 type casting on `apply_filter` or is it too defensive and out of scope.

 I'm asking because for me it would be reasonable if I got an `int` I
 should return an `int` but in the PHP world things grow hazy on the
 matter.

 Should I cast also the `found_posts` filter a couple of lines below, as
 well?

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


More information about the wp-trac mailing list