Is there a way to replace the WP_List_Table object of a post type to display said post type differently on the Admin edit.php page?
2 comments
Comments are closed.
Is there a way to replace the WP_List_Table object of a post type to display said post type differently on the Admin edit.php page?
Comments are closed.
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
toFALSE
to prevent the built-in page, and add a custom page for the post type listing to show the editable items.Result
This example is applied to
post
post type. This is leveraging theWP_Posts_List_Table
class andviews-edit-{$post_type}
filter. This seem isn’t the best way, but it works:Make sure the class is loaded on your page:
Extend the
WP_Posts_List_Table
class to remove list table and define the custom content:Use it inside a filter hook:
Result: