[wp-trac] [WordPress Trac] #55359: get_option return value wrong

WordPress Trac noreply at wordpress.org
Thu Mar 10 11:06:48 UTC 2022


#55359: get_option return value wrong
--------------------------------+------------------------------
 Reporter:  malthert            |       Owner:  (none)
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Options, Meta APIs  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:  docs
--------------------------------+------------------------------
Changes (by johnbillion):

 * focuses:   => docs


Comment:

 This function can return a value of any type because of the `$default`
 parameter:

 {{{#!php
 get_option( 'i_dont_exist', 123 );
 }}}

 The `@return` documentation could do with improvement here but the return
 types look correct.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55359#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list