# post-carousel/4.0.2/src/blocks/shortcode/dynamicShortcode.js

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

- Page: https://pluginprobe.com/plugins/post-carousel/4.0.2/code/src/blocks/shortcode/dynamicShortcode.js
- Raw: https://pluginprobe.com/plugins/post-carousel/4.0.2/raw/src/blocks/shortcode/dynamicShortcode.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.2/code/src/blocks/shortcode/dynamicShortcode.js#L10-L20`.

```javascript
import { __ } from "@wordpress/i18n";

const DynamicShortcodeInput = ({ attributes: { shortcode }, shortCodeList, shortcodeUpdate }) => {
	return (
		<div className="spsp-gutenberg-shortcode editor-styles-wrapper">
			<select className="spsp-shortcode-selector" onChange={(e) => shortcodeUpdate(e)} value={shortcode}>
				<option value="0">{__("-- Select a Show --", "post-carousel")}</option>
				{shortCodeList.map((shortcodeItem) => {
					const title =
						shortcodeItem.title.length > 35
							? `${shortcodeItem.title.substring(0, 30)}.... #(${shortcodeItem.id})`
							: `${shortcodeItem.title} #(${shortcodeItem.id})`;

					return (
						<option key={shortcodeItem.id.toString()} value={shortcodeItem.id.toString()}>
							{title}
						</option>
					);
				})}
			</select>
		</div>
	);
};

export default DynamicShortcodeInput;

```
