_delete_site_logo_on_remove_custom_logo

函数
_delete_site_logo_on_remove_custom_logo ( $old_value, $value )
参数
  • (array) $old_value Previous theme mod settings.
    Required:
  • (array) $value Updated theme mod settings.
    Required:
定义位置
相关方法
_delete_custom_logo_on_remove_site_logo_delete_site_logo_on_remove_custom_logo_on_setup_theme_delete_site_logo_on_remove_theme_modsdelete_site_meta_delete_attachment_theme_mod
引入
-
弃用
-

delete_site_logo_on_remove_custom_logo: 当自定义标识被删除时,删除网站标识的操作。

当custom_logo主题模块被删除时,将删除site_logo。

function _delete_site_logo_on_remove_custom_logo( $old_value, $value ) {
	global $_ignore_site_logo_changes;

	if ( $_ignore_site_logo_changes ) {
		return;
	}

	// If the custom_logo is being unset, it's being removed from theme mods.
	if ( isset( $old_value['custom_logo'] ) && ! isset( $value['custom_logo'] ) ) {
		delete_option( 'site_logo' );
	}
}

常见问题

FAQs
查看更多 >