Last active
June 11, 2022 08:32
-
-
Save kagg-design/ec75b2056ba4a3ed776f6c8ec55af414 to your computer and use it in GitHub Desktop.
Open login page by Ctrl+Alt+L. Can be used as a mu-plugin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add shortcuts. | |
* | |
* @return void | |
*/ | |
function kagg_shortcuts() { | |
?> | |
<script> | |
window.addEventListener( 'keydown', function( event ) { | |
if ( event.ctrlKey && event.altKey && event.code === 'KeyL' ) { | |
window.location.href = '/wp-login.php'; | |
} | |
} ); | |
</script> | |
<?php | |
} | |
add_action( 'wp_print_footer_scripts', 'kagg_shortcuts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment