Replacing the List table of a Post Type

No, you cannot replace the list table. There is no filter, everything is hard-coded.

But you can change the post type registration, set show_ui to FALSE to prevent the built-in page, and add a custom page for the post type listing to show the editable items.

add_action( 'wp_loaded', function(){
    register_post_type(
        'test',
        array(
            'labels' => array(
                'name' => 'TEST'
            ),
            'public' => TRUE,
            'show_ui' => FALSE
        )
    );
});

add_action( 'admin_menu', function(){
    add_object_page(
        'TEST',
        'TEST',
        'edit_test',
        'test',
        function(){
            echo 'test'; // list post type items here
        }
    );
});

Result

screen shot

Leave a Comment