Custom blocks not showing in Patterns

Hey guys, trying to solve a strange issue and would appreciate your help.

I create my custom blocks using AcfComposer and all seem to be working fine. All blocks are visible in page block inserter and rendered correctly. However, when I create a new pattern in Patterns (Appearance -> Design -> Patterns), none of them is available in the block inserter.

Strangely, in the page editor I can click on the block and create a pattern from there. However, when I go to Patterns and edit this newly created pattern from there I only see this error message.

Do I need to allow something else?

Many thanks for help.

1 Like

The problem was that I explicitly allowed only page post type in block definition.

/**
 * The block post type allow list.
 *
 * @var array
 */
public $post_types = ['page'];

Just leave the array empty and all works fine.

public $post_types = [];

There is however another issue described on ACF forums which was introduced by the WP 6.8.

1 Like