我正在尝试创建一个新的组块,其中包括一个core/heading
阻止,然后阻止core/gallery
块我不希望编辑器能够向组中添加其他内部块。我也不希望编辑器能够删除标题或库块。
以下是迄今为止我的区块变化:
wp.blocks.registerBlockVariation("core/group", {
name: "logo-grid",
title: "Logo Grid",
description: "",
category: "media",
icon: "smiley",
scope: ["inserter"],
attributes: {
},
innerBlocks: [
["core/heading", { level: 2, placeholder: "Heading" }],
["core/gallery"],
],
});
我已经调查过了templateLock
和template_lock
和lock
属性,但似乎都不适用于块变化?我意识到我可能使用了错误的工具,试图使用此功能创建块变体。对于如何实现我的目标,有什么建议吗?