What Does The Last Line Of Code Do

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


// 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 );


add_filter is built in function of wordpress which is used to add Hooks . In simple word above code will invoke method redirect_user_to once user login and redirect to next URL happen. From the code of redirect_user_to it seems that it check if current logged in user is member then redirect it to home page or else redirect to page from which he was initially redirected to Login page. Hope this helps you.

Thanks, what is the 10 and 3

If you check the wordpress document then it will be clear that 10 is priority and 3 is number of argument for your hook method.

Ok thanks for your help