[wp-trac] [WordPress Trac] #52798: delete_option() does not clear cache if option is missing in database.

WordPress Trac noreply at wordpress.org
Fri Mar 19 17:56:33 UTC 2021


#52798: delete_option() does not clear cache if option is missing in database.
--------------------------------+------------------------------
 Reporter:  emrikol             |       Owner:  (none)
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Options, Meta APIs  |     Version:  trunk
 Severity:  minor               |  Resolution:
 Keywords:  2nd-opinion         |     Focuses:
--------------------------------+------------------------------

Comment (by mdbitz):

 Alternatively an approach could be to check the value of get_option before
 the early return. This way if there was a value stuck in persistent object
 cache we would still perform the db delete and wp_cache_* calls.


 {{{
 if ( is_null( $row ) && false === get_option( $option ) ) {
    return false;
 }
 }}}

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


More information about the wp-trac mailing list