How to add custom redirect for user after login

How can I redirect a user to settings if a field in the registration form has not been submitted with this code?

add_filter(
	'hivepress/v1/forms/user_login',
	function( $form ) {
		
			$form['redirect'] = 'custom-link';
		

		return $form;
	},
	1000
);

Hi,

We recommend using this hook: template_redirect – Hook | Developer.WordPress.org, and then check is_user_logged_in and wp_redirect, for example. And you can additionally check whether the user has the necessary parts.

​I hope this is helpful to you.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.