getBlockVariations(…) is undefined in Widget and Template Part editors but not Post Editor
Here’s why did you get an undefined The function itself was defined, but the function call (wp.blocks.getBlockVariations( ‘core/embed’ )) returned an undefined because by the time that you called the function, the block/Gutenberg editor had not yet been initialized. Hence, undefined was returned instead of an array of block variations, because core block types like … Read more