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

Zac Gordon

Hey Mike!

This should be possible with the blocks.getSaveContent.extraProps filter. It let’s you get the props, which includes the attributes, as well as return a new props, which includes the className, so you should be able to update classname using attributes, if that is what you are after.

Not exact solutions, but examples that should get you there:

Let me know if you need a hand tweaking this to your need or if I’m missing something!