Opened 15 years ago
Closed 11 years ago
#18817 closed enhancement (wontfix)
WP_List_Table nonce output moved to its own method
| Reported by: | bigdawggi | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Plugins | Version: | 3.2.1 |
| Severity: | minor | Keywords: | has-patch |
| Cc: | Focuses: |
Description
A quick little patch to move the nonce field generation and output to its own field. I ran across a need for this when implementing the class on a postmeta box on the post edit screen. Both the post edit form and the WP_List_Table class were outputting a nonce field using the name "_wpnonce". Upon submission this was prohibiting the post from saving.
I had to override the entire display_tablenav method whereas if the output of the nonce was its own method, I could override it there and change the name of the field it was outputting.
Attachments (1)
Change History (6)
#3
@
13 years ago
This still seems like it needs addressed. I checked and the implementation in the original patch should still work.
#5
@
11 years ago
- Milestone Awaiting Review
- Resolution → wontfix
- Status new → closed
I can see the merit in your request, as I've run into a very similar problem recently and, like you, ended up completely overriding the display_tablenav() method.
In the case of the list table class, it's built in such a way that it's inherently meant to be overridden and with that structure comes a certain predictability. I think the best move is to leave it as-is. As you said, even if we were to relocate the generated nonce to a new method, you'd still have to override the new one. The problem would become more localized, yes, but mostly just relocated.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch to move the output of the nonce field for the WP_List_Class table to its own method