WoWWiki

This wiki contains inaccurate and out-of-date information. Please head over to https://wowpedia.fandom.com for more accurate and up-to-date game information.

READ MORE

WoWWiki
This page documents a user-defined function that you can copy and paste into your addon. Replace <PREFIX> with your AddOn's prefix to avoid conflicts between different versions of these functions.

User defined functions < UnregisterEventFromAllFrames

Globally unregister event.

Code[]

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[]

-- Globally unregister the event 'MERCHANT_SHOW'.
UnregisterEventFromAllFrames('MERCHANT_SHOW')