#18845 closed enhancement (fixed)
Introduce __return_null()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.4 |
| Component: | General | Version: | 3.3 |
| Severity: | normal | Keywords: | has-patch commit 3.4-early |
| Cc: |
Description
I've recently had some uses for __return_null().
Attachments (1)
Change History (9)
johnbillion — 20 months ago
comment:1
johnbillion — 20 months ago
- Keywords has-patch added
comment:3
in reply to:
↑ 2
johnbillion — 20 months ago
- Keywords reporter-feedback removed
Replying to 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.
- Keywords commit 3.4-early added
- Milestone changed from Awaiting Review to Future Release
I doubt there's much of a use case for returning null but it's nice to have the consistent function.
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed
In [19607]:
Note: See
TracTickets for help on using
tickets.

Could you list those uses by any chance?