Skip to content

Instantly share code, notes, and snippets.

@ahmadawais
Last active November 23, 2017 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmadawais/0ae9a4e20728cd8273b9c496d00f41f2 to your computer and use it in GitHub Desktop.
Save ahmadawais/0ae9a4e20728cd8273b9c496d00f41f2 to your computer and use it in GitHub Desktop.
WP: Check the Remember Me checkbox on WP Login Page automatically.
/**
* Check Remember me.
*
* Check the Remember Me checkbox on WP Login Page automatically.
*
* @since 1.0.0
* @author AhmadAwais (https://AhmadAwais.com/)
*/
function aa_auto_remember_me() {
add_filter( 'login_footer', function() {
echo "<script>document.getElementById('rememberme').checked = true;</script>";
} );
}
add_action( 'init', 'aa_auto_remember_me' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment