• I’m curious if it would be possible to add attributes to the elements nested within blocks, based on which block it was. The specific use case for this I’m looking for is to be able to add a ‘download’ attribute to the anchor element within a button block, though it may be something to consider for other blocks. Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author websevendev

    (@websevendev)

    This plugin is using the blocks.getSaveContent.extraProps filter and it only applies to the root element, so it’s not possible to add attributes to nested elements.

    You can do something like add a custom HTML block with a <script> that applies the download attributes dynamically when the page is loaded or find a third party button block that doesn’t use a wrapper element.

Viewing 1 replies (of 1 total)
  • The topic ‘Request: Adding Attributes to Nested Elements’ is closed to new replies.