#50432 closed defect (bug) (duplicate)
set_screen_options filter broken in 5.4.2
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 5.4.2 |
| Component: | Administration | Keywords: | |
| Focuses: | Cc: |
Description
My screen options stopped working in my plugin. When I change the value of the 'per_page' value I have setup it never gets saved to the user meta. I traced this to the misc.php core file where it looks like someone added some code in 5.4.2 to the 'default' switch condition. There is an if block in there that runs correctly with my filter added, but then the next block of code always executes and wipes out the returned value with 'false' so nothing ever gets saved to the user metadata. The bad code starts at line 688 in misc.php
Change History (2)
#1
@
5 years ago
- Component changed from General to Administration
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
#2
@
5 years ago
Yes, I also have the same issue.
I think it does not make sense to use the set_screen_option_{$option} filter since this function is listening to POST action.
If we have to use the filter, then we must make another POST action listening code.
CMIIW
Hi there, welcome to WordPress Trac!
Thanks for the report, we're already tracking this issue in #50392.
As a workaround until the issue is fixed, I'd recommend switching to the newer
set_screen_option_{$option}filter, which should work as expected.