[wp-trac] [WordPress Trac] #18845: Introduce __return_null()

WordPress Trac wp-trac at lists.automattic.com
Sun Oct 2 20:21:34 UTC 2011


#18845: Introduce __return_null()
-------------------------+------------------------------
 Reporter:  johnbillion  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  3.3
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------
Changes (by johnbillion):

 * keywords:  has-patch reporter-feedback => has-patch


Comment:

 Replying to [comment:2 scribu]:
 > Could you list those uses by any chance?
 Sure. The transient API and the options API let you short-circuit values
 using the `pre_transient_{transient}` and `pre_option_{option}` filters.
 `__return_null()` allows a null short circuit value. `__return_false()`
 can't be used because the short circuits use === to check for false.

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


More information about the wp-trac mailing list