In the WordPress codex, following is highlighted in red for WP List Table
.
“This class’s access is marked as private. That means it is not intended for use by plugin and theme developers as it is subject to change without warning in any future WordPress release.”.
Is there any way to add bulk action and sorting functionalities like (WP_List_Table
is doing) in custom plugins and how to use it?
If
WP_List_Table
is working for you, then you can just make a copy of this class. And use that.In the WordPress codex, Also says:
You may define a new class so that it will not interfere with the existing
WP_List_Table
Class.Then you can extend this class and use it like:
This way if WordPress remove or change the class will not affect your implementation.
For using the WP_List_Table functionality in a custom plugin, we can do one thing like below:
In this way,we can add bulk action and sorting functionalities like (WP_List_Table is doing) in custom plugins and so no need to test our plugin everytime a new WordPress version is released.