Building on what Xrystal wrote...
Code:
/run hooksecurefunc("CompactUnitFrame_UpdateName", function(self) if self.name then self.name:SetText(UnitExists(self.unit) and UnitClass(self.unit) or "Unknown") end end)
/run hooksecurefunc("UnitFrame_Update", function(self) if self.name then self.name:SetText(UnitExists(self.unit) and UnitClass(self.unit) or "Unknown") end end)
Or as an addon...
Lua Code:
hooksecurefunc("CompactUnitFrame_UpdateName", function(self)
if self.name then
self.name:SetText(UnitExists(self.unit) and UnitClass(self.unit) or "Unknown")
end
end)
hooksecurefunc("UnitFrame_Update", function(self)
if self.name then
self.name:SetText(UnitExists(self.unit) and UnitClass(self.unit) or "Unknown")
end
end)