Getting custom fields for a post from within Gutenberg
-
I’m building a block that is basically a staff display block, it pulls data from a custom post type called “Staff” and displays it in a div. I am selecting this data via a select box in the sidebar that is populated with the custom post types. When I choose my staff member from the select box, I get all the information I need, except for the custom fields.
This is how I’m getting my post list:edit: withSelect( function( select ) { return { posts: select( 'core' ).getEntityRecords( 'postType', 'lawyers' ) }; } ) ( function( props ) {
How do I get the custom fields for these posts inside a block?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Getting custom fields for a post from within Gutenberg’ is closed to new replies.