admin管理员组文章数量:1431720
At moment i am developing a Wordpress-Plugin where I have to print a custom table in the admin-menu. After a short research I found the solution with WP_List_Table. But on the Class Reference from Wordpress I saw that the class is marked as private, that means it is not intended for use by plugin and theme developers.
So is it recommended to use this class or should I print the table with "plain" php?
At moment i am developing a Wordpress-Plugin where I have to print a custom table in the admin-menu. After a short research I found the solution with WP_List_Table. But on the Class Reference from Wordpress I saw that the class is marked as private, that means it is not intended for use by plugin and theme developers.
https://codex.wordpress/Class_Reference/WP_List_Table
So is it recommended to use this class or should I print the table with "plain" php?
Share Improve this question asked Apr 8, 2019 at 10:51 eh irgendwereh irgendwer 111 bronze badge 1- The advice in your link sounds good to me: either use it and accept the risk that it might break at some point (but it's been 7+ years) or make a renamed copy of the class in your plugin and use that instead. – Rup Commented Apr 8, 2019 at 11:00
1 Answer
Reset to default 0The thing we have to say first here is that Codex officially informs that:
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. If you would still like to make use of the class, you should make a copy to use and distribute with your own project, or else use it at your own risk.
So at first glance, it's a bad idea to use it in your plugin. But...
It still is very handy class and it saves you a lot of coding. It also makes very easy to code UI that is consistent with other WP parts...
Another reason to use it is that a lot of plugins do.
So yes - I would go for it and use it in my plugin. But I'd have on my mind that it's a little bit risky and maybe someday my plugin will stop working because of WP update - so I'll have to test it against new versions or track changes in this class.
本文标签: plugin developmentis it recommended to use WPListTable
版权声明:本文标题:plugin development - is it recommended to use WP_List_Table? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745557313a2663263.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论