import {addFilter} from "@wordpress/hooks"; function coverApplyExtraClass(extraProps, blockType, attributes) { const { hideOnMobile, hideOnTablet, hideOnDesktop } = attributes; if (typeof hideOnMobile !== "undefined" && hideOnMobile) { extraProps.className = extraProps.className + " hide-on-mobile"; } if (typeof hideOnTablet !== "undefined" && hideOnTablet) { extraProps.className = extraProps.className + " hide-on-tablet"; } if (typeof hideOnDesktop !== "undefined" && hideOnDesktop) { extraProps.className = extraProps.className + " hide-on-desktop"; } return extraProps; } addFilter( "blocks.getSaveContent.extraProps", "awp/cover-apply-class", coverApplyExtraClass );