PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 4.0.2
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v4.0.2
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
post-carousel / src / blocks / shortcode / block.js

block.js in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.2, at src/blocks/shortcode/block.js

41 lines 943 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { registerBlockType } from "@wordpress/blocks";
2 import { ShortCodeBlockIcon, ShortCodePreviewImage } from "./icons";
3 import Edit from "./edit";
4 import { isBlockEnabled } from "../../utils";
5
6 const options = {
7 apiVersion: 3,
8 icon: ShortCodeBlockIcon,
9 category: "sp-smart-post-show",
10 name: "smart-post-show-pro/shortcode",
11 title: "Shortcode Views",
12 description: "Use Smart Post to insert a shortcode in your page.",
13 supports: {
14 align: ["wide", "full"],
15 // inserter: false,
16 },
17 example: {
18 attributes: {
19 preview: true,
20 },
21 },
22 edit: (props) =>
23 props.attributes.preview ? (
24 <div className="spsp_shortcode_block_preview_image">
25 <ShortCodePreviewImage />
26 </div>
27 ) : (
28 <Edit {...props} />
29 ),
30 save: () => null,
31 };
32
33 // registerBlockType(options.name, options);
34 const registerBlockTypeFn = () => {
35 if (isBlockEnabled("shortcode")) {
36 registerBlockType(options.name, options);
37 }
38 };
39
40 registerBlockTypeFn();
41