[wp-trac] [WordPress Trac] #20439: Introduce __return_one function

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 30 18:37:22 UTC 2012


#20439: Introduce __return_one function
-----------------------------+------------------------------
 Reporter:  bananastalktome  |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  General          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+------------------------------

Comment (by nacin):

 Replying to [comment:1 scribu]:
 > I would argue that even `__return_zero()` isn't common enough.

 I just had a pretty good use case for `__return_zero()` — I wanted to hook
 into pre_option_{$option} and turn an option off. Normally I would use
 `__return_false` but that is the value passed in that needs to be changed
 for the bypass to work (rather than null). So 0 it is.

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


More information about the wp-trac mailing list