Site icon Hip-Hop Website Design and Development

Tips on how to get the Gutenberg picture block to indicate new Media Library itemizing

I registered a brand new customized publish kind block with out a difficulty. Here is the fundamental code I used, courtesy of Cloudways:

    /*Register WordPress  Gutenberg CPT */
    perform cw_post_type() {
        register_post_type( 'portfolio',
            // WordPress CPT Choices Begin
            array(
                'labels' => array(
                    'identify' => __( 'Portfolio' ),
                    'singular_name' => __( 'Portfolio' )
                ),
                'has_archive' => true,
                'public' => true,
                'rewrite' => array('slug' => 'portfolio'),
                'show_in_rest' => true,
                'helps' => array('editor')
            )
        );
    }
     
    add_action( 'init', 'cw_post_type' );

My query: how do I get a picture block, that I add to the publish, present the "new" Media Library itemizing (that is the one with the blue icons to indicate a listing or grid). As a substitute, the one that’s pulled up, for need of a greater phrase, is "classic," and solely exhibits a grid possibility and no choices to type, and so on.

What am I lacking?

Replace: Tom J had me going again and performing some extra exploring. Because it seems, any try so as to add a picture to a Gutenberg block, or the basic editor, will use the identical show of the Media Library. The one approach to get the choice to view media as a listing or grid, or to type, is to entry the Media Library from the admin menu.

Should you down vote, I will perceive.