Update Image attributes in wordpress Gutenberg with javascript

407 Views Asked by At

I am trying to update class attribute of a figure image block in wordpress Gutenberg. When I modify block attributes, changes are not taken into account

wp.data
    .dispatch("core/block-editor")
    .updateBlockAttributes(curblock.clientId, curblock.attributes);
  wp.data
    .dispatch("core/block-editor")
    .updateBlock(curblock.clientId, curblock.attributes);

This piece of code is working well with text block but not with the image, anyone knows how to perform update of the block and save it?

Thank you

0

There are 0 best solutions below