#55359 closed defect (bug) (wontfix)
get_option return value wrong
| Reported by: | malthert | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Options, Meta APIs | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | docs |
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
@
5 years ago
Version 0, edited 5 years ago by
(next)
#2
@
5 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