MWDelaney / sage-acf-wp-blocks

Composer library for generating ACF Gutenberg blocks from templates. Intended for use with Roots/Sage (http://roots.io)
347 stars 65 forks source link

Blocks not available in WP custom post type #56

Closed timichango closed 3 years ago

timichango commented 3 years ago

Hello! I've created a custom post type, with Gutenberg enabled. However, I'm not able to see any of my ACF blocks registered via this library in that context — they're simply not shown in the list of available blocks.

The blocks in question DO appear in default pages/posts types — just not in the custom post type.

Is this a known issue? A bug? Is there a workaround?

Sincere thanks in advance for any help with this, T

MWDelaney commented 3 years ago

Make sure you haven't left in the default example value for PostTypes: in the comment at the top of your block template file.

timichango commented 3 years ago

OMG.. DERP. That was totally it. I hadn't added my custom post type to the PostTypes setting in the block template's config. Which... is extra embarrassing, because I was totally aware of that setting, as the ability to assign custom blocks to exclusively to my custom post type was the whole damned reason I made the post type in the first place.

A million thanks, Tim

timichango commented 3 years ago

Also, a billion thanks for this library. It's exactly the solution I needed for the project I'm working on, and likely for others in the future.