UNPKG

@wordpress/block-library

Version:
29 lines (27 loc) 575 B
/** * WordPress dependencies */ import { registerBlockType } from '@wordpress/blocks'; /** * Function to register an individual block. * * @param {Object} block The block to be registered. * * @return {?WPBlockType} The block, if it has been successfully registered; * otherwise `undefined`. */ export default function initBlock(block) { if (!block) { return; } const { metadata, settings, name } = block; return registerBlockType({ name, ...metadata }, settings); } //# sourceMappingURL=init-block.js.map