Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Talk:Class Reference/WP List Table

ADD RESPONSES HERE

Newer responses should go at the top.


Thanks. I am aware of the controversy surrounding developer usage of WP_List_Table, and I disagree with Nacin's "DO NOT USE" statement. WP_List_Table is essentially the Walker class of the WordPress admin. It serves an important function that MUST be available to developers. Worst case scenario, core institutes a breaking change... I'll know about it immediately as lots of my own stuff will break, and I will update the documentation and the WP_List_Table Example plugin immediately (I also follow core developments voraciously, so I will almost certainly know about breaking changes before they occur).

Should the core team intentionally try to lock down WP_List_Table example at this point, it would be an act of spite as WP_List_Table is already widely used and that would break countless plugins... and that sort of thing just doesn't happen in the WordPress community. However, being open and honest in the documentation about the likelihood of breaking changes is fair and reasonable. If anyone is really paranoid about this, they can duplicate the class, rename it, and use their version forever without fear of any breaking changes.

Either way, the class provides a consistent, semantic way to generate List Tables in the WordPress admin, and telling people NOT to use it is shortsighted and dangerous. Do you remember what things were like before WP_List_Table became widely used? It was horrible. There was no consistency whatsoever between any custom plugins that created list tables in admin. We can't, and shouldn't, ever go back to that.

But moreso, the thing that really gets me miffy is when people start deleting useful information from the codex (like the "For Developers" section). That's just not okay. Put a warning there, but if it's relevant, don't delete it. The Codex exists for the benefit of developers and the WordPress community in general.

Veraxus 16:51, 23 September 2013 (UTC)

I think what you've done here is fine, BTW.

Jdgrimes 16:15, 23 September 2013 (UTC)

I'm not saying I completely disagree with you - but if just any casual dev uses this in their plugin or theme and then things change, the core devs will get blamed for messing up all their stuff for no reason. The core devs are saying this to try to cover backs - if they change something major with this "API", and folks complain, they will be able to say, "We told you so". They just never intended it to be an API.

Jdgrimes 16:10, 23 September 2013 (UTC)

Have you read this link? http://wpengineer.com/2426/wp_list_table-a-step-by-step-guide/#comment-9617 The warnings on this page are based on the opinions of the core developers, not just other plugin developers. If you disagree you should take it up with Nacin and other core devs.

Jdgrimes 16:05, 23 September 2013 (UTC)

Veraxus on 2013.09.23

Marking this class as private is EXTREMELY INAPPROPRIATE as there is no other "official" method for creating consistent, stable, hookable list tables in WordPress. The alternative is chaos and asking or requiring developers to create List Tables from scratch is not only (as already mentioned) inappropriate, but will damage WordPress in the long run. Things can and will change in core, and WP_List_Table is no exception - it is the onus of the developer to keep their plugins up to date in lieu of major or breaking changes.

We should let the warnings stand that the class is subject to change, but using any language even similar to "developers should not use this class" should be removed immediately as it is just not appropriate. If you disagree, please continue this discussion here. In the mean time, I am rewriting the warnings.