Creating Gutenberg Block to Display Custom Post
-
Hello!
I am currently trying to make a plugin that adds a custom post type called “Representatives” to WordPress. When creating a new Representative, the user is given a classic editor that asks them to fill out a few metaboxes like “First Name,” “Last Name,” “Position,” and “Short Bio”.
I am now trying to create a Gutenberg block that will have a <SelectControl> where the user will be able to choose a created Representative from a drop-down list. And display the information in the block.
I tried to follow this tutorial:
https://www.ibenic.com/create-gutenberg-block-displaying-post/
But I cannot get the API to fetch the Representatives. (I also know that some parts of this tutorial is outdated, such as InspectorControls now being in wp.editor).
Can anyone help me understand how to use <SelectControl> with a custom post type?`
- The topic ‘Creating Gutenberg Block to Display Custom Post’ is closed to new replies.