How do I get Posts List block to show my custom post type?

[ad_1]

I'm working on a small plugin that uses a custom post type. I would like to create a page that lists all posts of that type. The Posts List block's description states that plugins may add more post types to its filter, but I found no documentation on how to do that:

    register_post_type('test_post_type', array(
        'labels' => array(
            'name'          => __('Test Posts'),
            'singular_name' => __('Test Post'),
        ),
        'public'       => true,
        'publicly_queryable' => true,
        'rewrite'      => array('slug' => 'webhook_post'),
        'show_ui'      => true,
        'has_archive'  => false,
        'supports'     => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments'),
        'show_in_rest' => true,
    ));

https://preview.redd.it/cvf8qh2t83gd1.png?width=275&format=png&auto=webp&s=2b8cfc02a1d4d3babc8849f0e414946c90ccd72d

Under Post Type, only Post and Page are listed. How do I add my custom type?

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer