admin管理员组文章数量:1122846
I wonder if there is the deprecated for blocks.getSaveElement
hook?
First, I wrote the code like below.
const addWrapper = (el, type, attributes) => {
if ('myblock/example' === type.name) {
return <div className={"example"}>el<div>;
} else {
return el
}
};
addFilter('blocks.getSaveElement', 'block/example', addWrapper);
Then, I want to change the wrapper element, but this hooks still affect to deprecated blocks. I read the document / but, I can not find the solution. Is there an any way to solve it?
I wonder if there is the deprecated for blocks.getSaveElement
hook?
First, I wrote the code like below.
const addWrapper = (el, type, attributes) => {
if ('myblock/example' === type.name) {
return <div className={"example"}>el<div>;
} else {
return el
}
};
addFilter('blocks.getSaveElement', 'block/example', addWrapper);
Then, I want to change the wrapper element, but this hooks still affect to deprecated blocks. I read the document https://developer.wordpress.org/block-editor/developers/block-api/block-deprecation/ but, I can not find the solution. Is there an any way to solve it?
Share Improve this question asked Jan 19, 2021 at 0:50 naogifynaogify 112 bronze badges1 Answer
Reset to default 0I solve this problem by myself. The detail is here. https://github.com/WordPress/gutenberg/issues/28509
本文标签: Deprecated for blocksgetSaveElement
版权声明:本文标题:Deprecated for blocks.getSaveElement 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736291666a1928771.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论