[wp-trac] [WordPress Trac] #44579: get_option() is type aware now (returns Integers as Integers)
WordPress Trac
noreply at wordpress.org
Fri Jul 13 09:00:45 UTC 2018
#44579: get_option() is type aware now (returns Integers as Integers)
--------------------------+-----------------------------
Reporter: gdespoulain | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: minor | Keywords:
Focuses: |
--------------------------+-----------------------------
Hi,
I noticed that the get_option() function now returns the value type it was
originally given (ex. I give an INT in update_option(), then get_option()
returns an INT).
But the doc doesn't seems to agree with that:
**wp-includes/option.php**:
{{{
* Any scalar values will be returned as strings.
}}}
This text seems to be there for historical reasons
(https://core.trac.wordpress.org/ticket/31820) and something changed in
the code since then, but I can't find the related commit.
Proposed text to fix the doc:
{{{
* This function is type-aware: the return type will be the same as the
last given input value.
}}}
Thx!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44579>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list