How can I add arbitrary `data-` attributes to a block’s `edit()` container?
You can define a getEditWrapperProps function when you register the block, and return an object that sets the props for the wrapper. The function will be passed the props for the block, in case those are needed. registerBlockType( ‘wpse/example-get-edit-wrapper-props’, { title : ‘getEditWrapperProps() Example’, // … getEditWrapperProps( props ) { return { ‘data-foo’: ‘bar’, ‘data-quix’: … Read more