[wp-trac] [WordPress Trac] #39053: Add function `wp_validate_integer`

WordPress Trac noreply at wordpress.org
Mon Dec 26 01:56:20 UTC 2016


#39053: Add function `wp_validate_integer`
----------------------------------------------------+------------------
 Reporter:  peterwilsoncc                           |       Owner:
     Type:  enhancement                             |      Status:  new
 Priority:  normal                                  |   Milestone:  4.8
Component:  General                                 |     Version:
 Severity:  normal                                  |  Resolution:
 Keywords:  has-patch has-unit-tests needs-refresh  |     Focuses:
----------------------------------------------------+------------------
Changes (by peterwilsoncc):

 * keywords:  has-patch has-unit-tests => has-patch has-unit-tests needs-
     refresh
 * milestone:  Awaiting Review => 4.8


Comment:

 Replying to [comment:1 voldemortensen]:
 > My real question though, is what is the need for the `default`
 parameter? I can't see a reason someone would want anything but false if
 the thing being checked isn't an integer.

 It might be preferable to return a WP_Error rather than false. I'll add
 that as a specific test case.

 Mainly, I've included it to match the PHP signature.

 Thanks for picking up the docblock changes needed. I'll fix them up.

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


More information about the wp-trac mailing list