-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding new post shortcut #34
Adding new post shortcut #34
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 + N
to be the Mac shortcut andAlt + Shift + N
to 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.href
or 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.