This page documents a user-defined function that you can copy and paste into your addon. Replace PREFIX with your addon or lib prefix to avoid conflicts between different versions of these functions.

User defined functions

Globally unregister event.

Code[edit | edit source]

local function UnregisterEventFromAllFrames_helper(event, ...)
	for i=1,select('#', ...) do
		select(i, ...):UnregisterEvent(event)
	end
end

local function UnregisterEventFromAllFrames(event)
	UnregisterEventFromAllFrames_helper(event, GetFramesRegisteredForEvent(event))
end

Example[edit | edit source]

-- Globally unregister the event 'MERCHANT_SHOW'.
UnregisterEventFromAllFrames('MERCHANT_SHOW')
Community content is available under CC-BY-SA unless otherwise noted.