Make an lua file, and add it to the toc then do something like:
local eventframe = CreateFrame("Frame", "eventframe");
local function hide()
ShapeshiftBarFrame:Hide();
ShapeshiftBarFrame:UnregisterAllEvents();
end
eventframe:RegisterEvent("PLAYER_ENTERING_WORLD");
eventframe:SetScript("OnEvent", hide);
or
ShapeshiftBarFrame:SetScript("OnEvent", function()
ShapeshiftBarFrame:Hide()
ShapeshiftBarFrame:UnregisterAllEvents();
end)
I'm not really sure whats considered the best way to do it is, but both work.