Object:GetParentKey

From Warcraft Wiki
Jump to navigation Jump to search

Returns the key on the parent that references this object.

parentKey = Object:GetParentKey()

Returns

parentKey
string?

Example

Sets a parent key and prints the name of the parent key.

local parent = CreateFrame("Frame")
local f = CreateFrame("Frame", nil, parent)

print(f:GetParentKey()) -- nil
f:SetParentKey("hello")
print(f:GetParentKey()) -- "hello"

print(parent.hello == f) -- true

Patch changes

Dragonflight Patch 10.0.0 (2022-10-25): Added.