# post-carousel/4.0.3/src/blocks/shortcode/block.js

Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog &amp; News, version 4.0.3. 41 lines.

- Page: https://pluginprobe.com/plugins/post-carousel/4.0.3/code/src/blocks/shortcode/block.js
- Raw: https://pluginprobe.com/plugins/post-carousel/4.0.3/raw/src/blocks/shortcode/block.js
- Modified: 2026-04-24T11:48:54+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/post-carousel/4.0.3/code/src/blocks/shortcode/block.js#L10-L20`.

```javascript
import { registerBlockType } from "@wordpress/blocks";
import { ShortCodeBlockIcon, ShortCodePreviewImage } from "./icons";
import Edit from "./edit";
import { isBlockEnabled } from "../../utils";

const options = {
	apiVersion: 3,
	icon: ShortCodeBlockIcon,
	category: "sp-smart-post-show",
	name: "smart-post-show-pro/shortcode",
	title: "Shortcode Views",
	description: "Use Smart Post to insert a shortcode in your page.",
	supports: {
		align: ["wide", "full"],
		// inserter: false,
	},
	example: {
		attributes: {
			preview: true,
		},
	},
	edit: (props) =>
		props.attributes.preview ? (
			<div className="spsp_shortcode_block_preview_image">
				<ShortCodePreviewImage />
			</div>
		) : (
			<Edit {...props} />
		),
	save: () => null,
};

// registerBlockType(options.name, options);
const registerBlockTypeFn = () => {
	if (isBlockEnabled("shortcode")) {
		registerBlockType(options.name, options);
	}
};

registerBlockTypeFn();

```
