Skip to content

Instantly share code, notes, and snippets.

Avatar

Laura Sage ThePixelPixie

View GitHub Profile
View remove-admin-login-redirect.php
// Custom remove admin login redirect
function admin_login_redirect( $redirect_to, $request, $user )
{
global $user;
if( isset( $user->roles ) && is_array( $user->roles ) ) {
if( in_array( "administrator", $user->roles ) ) {
return $redirect_to;
} else {
return home_url();
}
View remember-me.php
// Set Remember Met to checked
function login_checked_remember_me() {
add_filter( 'login_footer', 'rememberme_checked' );
}
add_action( 'init', 'login_checked_remember_me' );
function rememberme_checked() {
echo "<script>document.getElementById('rememberme').checked = true;</script>";
}
// END set Remember Me