Make WordPress Core

Opened 4 years ago

Last modified 13 hours ago

#17133 new enhancement

Register ctrl + s event for plugin/theme editor

Reported by: jcnetsys Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.1
Component: Plugins Keywords: ux-feedback has-patch needs-refresh
Focuses: administration Cc:


Often when modifying code or writing a post using the wordpress editor I instinctively hit ctrl + s to save it. Up pops the save website dialog which I then have to close. In Gmail when I hit ctrl+ s it saves the email to drafts. I think a similar thing would be useful for wordpress.

Attachments (1)

keystroke_save.patch (2.0 KB) - added by evansolomon 4 years ago.
Allow CMD/CTRL + S to save a file in the theme or plugin editor

Download all attachments as: .zip

Change History (13)

comment:1 @ocean904 years ago

  • Component changed from Autosave to Administration

Ctrl+S has been introduced at some point

See #5598

comment:2 @jcnetsys4 years ago

So it has - for new posts. Could this feature be implemented for the plugin/theme editor also.

comment:3 @ocean904 years ago

  • Keywords 2nd-opinion removed
  • Summary changed from Register ctrl + s event for editors to Register ctrl + s event for plugin/theme editor

comment:4 @scribu4 years ago

  • Milestone changed from Awaiting Review to Future Release

Sounds like a no-brainer. +1

Last edited 4 years ago by scribu (previous) (diff)

comment:5 @andrewryno4 years ago

Would it also be worth it to expand this to register on all editors that have a "Save" button? For example, I was just thinking of widgets. I type a lot of HTML code in there and I automatically would try to save using the keyboard shortcut.

comment:6 @chacha1024 years ago

  • Cc chacha102 added

@evansolomon4 years ago

Allow CMD/CTRL + S to save a file in the theme or plugin editor

comment:7 @SergeyBiryukov4 years ago

  • Keywords has-patch added; needs-patch removed

comment:8 @evansolomon4 years ago

I changed the submit button ID because jQuery's submit() function does not work on forms where the button has the ID "submit." Alternatively we could leave the name and use click() but this seemed like a cleaner option.

Version 0, edited 4 years ago by evansolomon (next)

comment:9 @chexee4 years ago

  • Keywords needs-refresh added

I like this and really can't think of a reason not to implement this. I actually hit CMD+S all the time on these editor pages when making quick fixes and get really annoyed when the Save As Web Page dialog comes up.

I tested Evan's patch. It works in FF, Chrome, and Safari on OS X, but not any browsers on Windows (the Save As dialog pops up).

Surprisingly it works within IE in IETester, so it must register the CTRL+S on some level.

comment:10 @johnbillion2 years ago

For those interested, I've started work on a general keyboard shortcuts plugin for WordPress: https://github.com/johnbillion/wordpress-keyboard-shortcuts.

It implements CMD+S/CTRL+S for saving posts, terms and user profiles. The plan is to expand it to settings and the plugin/theme editors too, and anywhere else it's relevant.

comment:11 @nacin20 months ago

  • Component changed from Administration to Plugins
  • Focuses administration added

comment:12 @chriscct713 hours ago

  • Severity changed from minor to normal
Note: See TracTickets for help on using tickets.