Adding a custom login option to the form removes the google login option

Hey. I’m not sure if it is a “bug” or a “user-error” on my part, but when I try to integrate a Vipps login/register option, together with the available social logins from the addon, it removes the login options from the social login addon.

Here is the snippet i use to get the “login with vipps” in the log in form and register form:

add_filter(
	'hivepress/v1/forms/user_login',
	function( $form ) {
		$form['header'] = do_shortcode('[login-with-vipps text="Log in with Vipps" application="wordpress"]');

		return $form;
	},
	1000
);

add_filter(
	'hivepress/v1/forms/user_register',
	function( $form ) {
		$form['header'] = do_shortcode('[continue-with-vipps text="Continue with Vipps" application="wordpress"]');

		return $form;
	},
	1000
);

Thank you :slight_smile:

1 Like

Please try concatenating the form header text (via .= ) instead of overriding it or you can also set a low priority for these custom functions (5 instead of 1000), then Social Login will add its buttons to the existing header text.

1 Like

Ooh this worked perfectly.

Thanks alot yevhen! <3 I’m learning my ways

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