Does anyone know what attributes to set on a SecureActionButton to summon a battle pet? I was sure I'd figured this out at one point, but when I went back to my notes and tested the code, it didn't work.
Code:
btn = CreateFrame("Button", "TestPet", UIParent, "SecureActionButtonTemplate,ActionButtonTemplate");
btn:SetAttribute("type", "summonpet");
btn:SetAttribute("summonpet", C_PetJournal.GetPetInfoByIndex(1));
btn:SetPoint("Center",UIParent)
I can't seem to find any documentation anywhere on what to set the "type" attribute to. GetActionInfo() helpfully tells me "summonpet" is a thing, but is that the type? It's own attribute? Both?