Simply casting the$attributes array to an object before running it though Schema validation
fails with ACF Pro's field groups. ACF outputs another nested array. Using JSON decode makes
sure that nested arrays are converted to objects as well.
There is also an issue with the HTML loader failing if there's no innerHTML defined in the block. HTML-less blocks are very useful for WordPress as a headless CMS with WPGraphQL.
I've added a check for empty HTML and added an empty span with a data-attr warning about the lack of innerHTML.
Simply casting the
$attributes
array to an object before running it though Schema validation fails with ACF Pro's field groups. ACF outputs another nested array. Using JSON decode makes sure that nested arrays are converted to objects as well.There is also an issue with the HTML loader failing if there's no innerHTML defined in the block. HTML-less blocks are very useful for WordPress as a headless CMS with WPGraphQL.
I've added a check for empty HTML and added an empty span with a
data-attr
warning about the lack of innerHTML.