# copy-the-code/5.2.0/includes/gutenberg/assets/src/utils.js

Copy Anything to Clipboard for WordPress – Copy Button, Copy Text &amp; Copy Code, version 5.2.0. 20 lines.

- Page: https://pluginprobe.com/plugins/copy-the-code/5.2.0/code/includes/gutenberg/assets/src/utils.js
- Raw: https://pluginprobe.com/plugins/copy-the-code/5.2.0/raw/includes/gutenberg/assets/src/utils.js
- Modified: 2026-02-01T23:32:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/copy-the-code/5.2.0/code/includes/gutenberg/assets/src/utils.js#L10-L20`.

```javascript
/**
 * WordPress dependencies
 */
import { registerBlockType } from '@wordpress/blocks';

/**
 * Function to register an individual block.
 *
 * @param {Object} block The block to be registered.
 *
 * @return {WPBlockType | undefined} 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 );
}
```
