PostTypeMultiple

TwebBlockPostTypeMultipleControl

{ label, help, postType*, name*, onChange, attributes*, setAttributes* }
/**
 * @param {string} [label] - Component label.
 * @param {string} [help] - Component description.
 * @param {string} postType - The post type name.
 * @param {string} name - Attribute name.
 * @param {function} [onChange] - Callback called when the value changes.
 * @param {object} attributes - Object containing block attributes.
 * @param {function} setAttributes - Function to set new block attribute values.
 */
block.json
"testPosts": {
	"type": "array",
	"default": []
}
index.js
import {
	TwebBlockPostTypeMultipleControl,
} from '@tigriweb/components/attributes';
index.js | edit()
<TwebBlockPostTypeControl
	label={ __('Posts Label', 'your-theme-name') }
	help={ __('Posts Description', 'your-theme-name') }
	postType="post"
	name="testPosts"
	{...{ attributes, setAttributes }}
/>

Last updated

Was this helpful?