I need to make major changes on the way the comments are rendered in backend, from the following file: wp-admin/includes/class-wp-comments-list-table.php
I know editing the WP Core files directly is a bad idea…
Is there a way to create an edited version of this file with custom plugin and let wordpress use the file inside the plugin and not the default class-wp-comments-list-table.php ?
Thank you.
The comments are displayed using an instance of the WP_Comments_List_Table class which is defined as the global variable $wp_list_table.
You could extend this class and then use any action after $wp_list_table is defined (admin_head-edit-comments.php would work) to create an instance of your own class, copy all properties of $wp_list_table to the instance of your class and replace $wp_list_table with it.
It’s not pretty but it will work and as long as there is no way to override _get_list_table() which defines the original $wp_list_table it’s all you’ve got.