• Hi, can some one tell me what the last line of code does: add_filter( ‘login_redirect’, ‘redirect_user_to’, 10, 3 );

    <?php
    
    // add this to the bottom of the functions.php file in yourt theme directory
    
    function redirect_user_to( $redirect_to, $user ) {
    	global $user;
    
    	if ( $user->user_login == 'member' ) {
    		$redirect_to = '/'; // redirect to home page
    		return $redirect_to;
    	}
    
    	return $redirect_to;
    }
    add_filter( 'login_redirect', 'redirect_user_to', 10, 3 );
    
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘What Does The Last Line Do’ is closed to new replies.