JavaScript for WordPress Forums Gutenberg Development Add class to container div? Reply To: Add class to container div?

#102481
Zac Gordon
Keymaster

This should be possible with the editor.BlockListBlock filter 🙂

`
const { createHigherOrderComponent } = wp.compose;

const withClientIdClassName = createHigherOrderComponent( ( BlockListBlock ) => {
return ( props ) => {
return ;
};
}, ‘withClientIdClassName’ );

wp.hooks.addFilter( ‘editor.BlockListBlock’, ‘my-plugin/with-client-id-class-name’, withClientIdClassName );
`

Here are the docs on it – https://wordpress.org/gutenberg/handbook/designers-developers/developers/filters/block-filters/#editor-blocklistblock

We get into Filters in the Advanced Gutenberg Course if you wanted some extra guidance with filters in general.