Changeset 52042 for trunk/src/wp-includes/blocks/site-logo.php
- Timestamp:
- 11/08/2021 02:26:27 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/site-logo.php
r51421 r52042 134 134 */ 135 135 function _delete_site_logo_on_remove_custom_logo( $old_value, $value ) { 136 global $_ignore_site_logo_changes; 137 138 if ( $_ignore_site_logo_changes ) { 139 return; 140 } 141 136 142 // If the custom_logo is being unset, it's being removed from theme mods. 137 143 if ( isset( $old_value['custom_logo'] ) && ! isset( $value['custom_logo'] ) ) { … … 144 150 */ 145 151 function _delete_site_logo_on_remove_theme_mods() { 152 global $_ignore_site_logo_changes; 153 154 if ( $_ignore_site_logo_changes ) { 155 return; 156 } 157 146 158 if ( false !== get_theme_support( 'custom-logo' ) ) { 147 159 delete_option( 'site_logo' ); … … 161 173 } 162 174 add_action( 'setup_theme', '_delete_site_logo_on_remove_custom_logo_on_setup_theme', 11 ); 175 176 /** 177 * Removes the custom_logo theme-mod when the site_logo option gets deleted. 178 */ 179 function _delete_custom_logo_on_remove_site_logo() { 180 global $_ignore_site_logo_changes; 181 182 // Prevent _delete_site_logo_on_remove_custom_logo and 183 // _delete_site_logo_on_remove_theme_mods from firing and causing an 184 // infinite loop. 185 $_ignore_site_logo_changes = true; 186 187 // Remove the custom logo. 188 remove_theme_mod( 'custom_logo' ); 189 190 $_ignore_site_logo_changes = false; 191 } 192 add_action( 'delete_option_site_logo', '_delete_custom_logo_on_remove_site_logo' );
Note: See TracChangeset
for help on using the changeset viewer.