#55359 closed defect (bug) (wontfix)
get_option return value wrong
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Options, Meta APIs | Keywords: | |
| Focuses: | docs | Cc: |
Description
https://developer.wordpress.org/reference/functions/get_option/
says it can return scalar including integer, which is false.
get_option can only return:
bool|null|string|array|object
Need to fix in phpdoc and documentation.
Change History (4)
#1
@
4 years ago
Version 0, edited 4 years ago
by
(next)
#2
@
4 years ago
- Focuses docs added
This function can return a value of any type because of the $default parameter:
get_option( 'i_dont_exist', 123 );
The @return documentation could do with improvement here but the return types look correct.
Note: See
TracTickets for help on using
tickets.
EDIT, it's actually:
bool|string|array|object