Created
July 31, 2018 19:00
-
-
Save lucprincen/6a3dc6e5aa3228cde8fc5c194d871719 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { __ } = wp.i18n; | |
const { InnerBlocks } = wp.editor; | |
const { registerBlockType } = wp.blocks; | |
registerBlockType( | |
'kit/container', | |
{ | |
title: __('Container'), | |
description: __('Add a container for blocks'), | |
category: 'common', | |
supports: { html: false }, | |
edit(props) { | |
const { className } = props; | |
return ( | |
<div className={className}> | |
<InnerBlocks /> | |
</div> | |
); | |
}, | |
save(props) { | |
const { className } = props; | |
return ( | |
<section className={className}> | |
<InnerBlocks.Content/> | |
</section> | |
); | |
} | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment