admin管理员组文章数量:1334389
Is it possible to apply inline styles to all blocks via filters? Or do only some blocks support it? basically I want to add the ability of adding a background image to a single column. So I added an extra attribute to store the background img url (named backgroundImg) and tested that its saved.
I am trying to use blocks.getSaveContent.extraProps to apply the background image to the inline style like so..
if ("wp-block-column" === props.className) {
return lodash.merge(props, {
style: {
backgroundImage: "url(" + props.backgroundImg + ")",
},
});
}
When I run this however the background IMG url is 'undefined'. However I have tested and know that props.backgroundImg is being saved. I can add more of my code as needed, but any ideas on why it isn't applying the saved url?
本文标签: filtersInline Styles on all native blocks
版权声明:本文标题:filters - Inline Styles on all native blocks 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742235471a2437998.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论