Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#18082 closed enhancement (wontfix)

Reset screen options button

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


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 7 years ago.
Functional first pass at adding a reset button for screen options
resetscreen.18082.2.patch (5.7 KB) - added by danielbachhuber 7 years ago.
Improvements per Nacin's recommendations

Download all attachments as: .zip

Change History (9)

#1 @chacha102
7 years ago

  • Cc chacha102 added

#2 @danielbachhuber
7 years ago

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

7 years ago

Functional first pass at adding a reset button for screen options

#3 @danielbachhuber
7 years ago

  • 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.

#4 @nacin
7 years ago

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.

7 years ago

Improvements per Nacin's recommendations

#5 @danielbachhuber
7 years ago

@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'.

#6 @danielbachhuber
7 years ago

  • 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

#7 @SergeyBiryukov
7 years ago

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