Support

Account

Home Forums Bug Reports get_block_wrapper_attributes() not working in first preview

Unread

get_block_wrapper_attributes() not working in first preview

  • When using get_block_wrapper_attributes() inside a block template, the first time the block gets rendered in the preview, it throws an error:

    > Trying to access array offset on value of type null

    This is because WP_Block_Supports doesn’t have an initialized block.

    This is a quick patch fix but probably the whole thing should be refactored to use native WP render methods no?

    https://gist.github.com/oxyc/dc646e094e1096972f17422052e87a6b

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.