Skip to content

Instantly share code, notes, and snippets.

View ThePixelPixie's full-sized avatar

Laura Sage ThePixelPixie

View GitHub Profile
// 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();
}
// 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