Skip to content

Latest commit

 

History

History

PostSelect

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

PostSelect

The PostSelect component allows for selecting a single posts from wanted post type using <select>.

Usage

For a minimum working setup, you need to define postId attribute and pass an taxonomy as postTypeName and other props.

import { PostSelect } from '@meom/block-components';

// Inside block `edit` function:
const {
    attributes: {},
    setAttributes,
} = props;

// `service` can be any post type slug.
<PostSelect
    postTypeName="service" {...props}
/>

postId

Post ID string.

Remember to define postId in block.json file as attribute:

"attributes": {
    "postId": {
        "type": "string"
    }
}