[wp-trac] [WordPress Trac] #49086: The "site_icon" option isn't always removed when the site icon is deleted

WordPress Trac noreply at wordpress.org
Tue Jan 7 15:48:52 UTC 2020


#49086: The "site_icon" option isn't always removed when the site icon is deleted
--------------------------+------------------------------
 Reporter:  henry.wright  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |     Focuses:
--------------------------+------------------------------
Changes (by henry.wright):

 * keywords:   => dev-feedback


Comment:

 I should clarify.

 When the site icon is removed by Appearance > Customize, the value of
 site_icon in the options table is set to 0.

 When the site icon image file is deleted by Media > Library, the value of
 site_icon in the options table remains something like 55.

 This causes problems because the result of `get_option( 'site_option' )`
 is used to determine if a site icon exists in functions like
 `get_site_icon_url()`.

 {{{
 $site_icon_id = get_option( 'site_icon' );

 if ( $site_icon_id ) {
     // This does not guarantee the site icon exists because of the bug
 above
 }
 }}}

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


More information about the wp-trac mailing list