[wp-trac] [WordPress Trac] #31047: Option nonexistence should not be checked against false

WordPress Trac noreply at wordpress.org
Sun Jan 18 20:00:49 UTC 2015


#31047: Option nonexistence should not be checked against false
--------------------------------+------------------------------
 Reporter:  GregLone            |       Owner:
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Options, Meta APIs  |     Version:  3.4
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:
--------------------------------+------------------------------

Comment (by GregLone):

 Ho, I forgot the important part, the possible solution x)
 Imho, it should be:
 {{{
 $old_value = get_option( $option );
 // ...
 if ( apply_filters( 'default_option_' . $option, false ) === $old_value )
     return add_option( $option, $value );
 }}}

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


More information about the wp-trac mailing list