Opened 23 months ago

Closed 20 months ago

Last modified 20 months ago

#18082 closed enhancement (wontfix)

Reset screen options button

Reported by: danielbachhuber Owned by: danielbachhuber
Priority: normal Milestone:
Component: Administration Version:
Severity: minor Keywords:
Cc: chacha102

Description

It would be nice to have a "Reset" button in screen options to restore any given admin view back to the factory defaults.

Attachments (2)

resetscreen.18082.1.patch (5.6 KB) - added by danielbachhuber 21 months ago.
Functional first pass at adding a reset button for screen options
resetscreen.18082.2.patch (5.7 KB) - added by danielbachhuber 21 months ago.
Improvements per Nacin's recommendations

Download all attachments as: .zip

Change History (9)

  • Cc chacha102 added
  • Keywords ux-feedback added
  • Owner set to danielbachhuber
  • Status changed from new to accepted

Functional first pass at adding a reset button for screen options

  • Keywords has-patch 2nd-opinion added

resetscreen.18082.1.patch adds a "Reset to defaults" button for all screen options. When the user clicks on the reset button, all of their personal screen options for the current screen are reset to factory defaults.

The patch works fine, I think the code is satisfactory, but I'd love feedback on the approach. Ideally, we'd just write an actual class and API for manipulating screen options. This could work fine in the interim though.

I would keep the if() logic in set_screen_options() and reset_screen_options(), and consider combining your reset_screen_options() with set_screen_options() -- it's nice and easy to have a single POST handler here.

Patch looks alright at a glance, but there's a lot moving around, so we'd have to look closer.

There should also be a hook so a plugin can reset theirs too.

Improvements per Nacin's recommendations

@nacin Added another patch per your recommendations. Specifically, I moved the $_POST checks to the methods (although I'd prefer to keep the set_ and reset_ methods separate because they do different things). Also, I added an action called 'reset_screen_options'.

  • Keywords ux-feedback has-patch 2nd-opinion removed
  • Resolution set to wontfix
  • Status changed from accepted to closed

Closing this as "wontfix" because both bugs (#18198, #16955) that having a "Reset" button provides a solution for are fixed as of WP 3.3

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.