Adding new post shortcut#34
Conversation
aurooba
left a comment
There was a problem hiding this comment.
I tested this briefly and it works great. Thanks for adding this @kkoppenhaver! I'm sorry it took me to so long to get to it. 😅 I've just left one comment about an import.
My other thought would be, should we add some sort of visual feedback when the keyboard shortcut is used, so that folks know it's actually working? You can see it working when you see the browser is loading a new page, but that's possibly a bit too subtle. What do you think?
|
Although as I'm thinking about it, perhaps there should be feedback regardless of how we press the button. So I can add that as a separate PR. Once you've reviewed the requested change on this, we can merge. :) |
|
Thanks @aurooba, I've taken care of that change and updated both README files to move this from an "upcoming feature" into the supported features list. Congrats on the podcast launch, by the way. I've been a listener since episode 1 :) |
|
@kkoppenhaver Thanks for the changes! :) I'm glad you like the podcast! :) Let us know if there are any particular topics you'd love to hear about! |
This is the first pass at adding a new post shortcut as identified in #2.
Because there seems to be some precedent with using Ctrl + Option (Mac) and Alt + Shift (Windows) for shortcuts in the WordPress editor, I've opted for
Ctrl + Option + Nto be the Mac shortcut andAlt + Shift + Nto be the Windows shortcut.This code listens for either of those key combinations to be pressed and then clicks the existing New Post button. This may be possible to use
window.location.hrefor something like that instead of simulating a click (especially if #7 gets merged and the button isn't always new post), but I think it should work for now.