Recently we had a Block Variation which needed to be switched from core/columns
to core/group
. Should have been easy enough, but the identity of the variation, its name and icon, would never show up. No matter what, the variation's isActive
method was not even being called.
It turns out that the various layouts available to the core/group
Group Block are all Block Variations. Each has it's own isActive
function, which simply checks the Block's layout.type
attribute and sometimes it's layout.orientation
.
The problem is that all of the isActive
functions for each of the Block's variations are run in order until one returns true, at which point WordPress stops checking. This is documented in the very last paragraph of the Block Editor Handbook's [V