Skip to content

Instantly share code, notes, and snippets.

@lucprincen
Created July 31, 2018 19:00
Show Gist options
  • Save lucprincen/6a3dc6e5aa3228cde8fc5c194d871719 to your computer and use it in GitHub Desktop.
Save lucprincen/6a3dc6e5aa3228cde8fc5c194d871719 to your computer and use it in GitHub Desktop.
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