I’m not sure about the second one (removing the wrappers), but as for limiting the allowed blocks:
First I want to make it so that the ONLY block that can be added as a
child block of thefeature-cards
is the child block. How can I
enforce this?
You can use the allowedBlocks
property of InnerBlocks
like so:
// In the edit() function of the feature-cards block type:
el( InnerBlocks, { allowedBlocks: [ 'feature-card' ] } )
And you should know that wp.editor.RichText
is deprecated, so use wp.blockEditor.RichText
instead. So in your feature-card
block type, you’d use var RichText = blockEditor.RichText;
and not var RichText = editor.RichText;
.
Also, you might also want to use useBlockProps
in your code. 🙂