User Clash Error Warning | WordPress.org

[ad_1]

Hey @nigelrs,

Thank you for reaching out! Yep, the way it currently works is somewhat unintuitive. We have some plans to refactor this part of the plugin to make it more user friendly. However, at this time I can’t say exactly when these changes will happen.

In the meantime, I recommend you to add the following code to your website:

function slicewp_custom_user_action_register_affiliate_new_message() {
	
	// Verify for nonce.
	if ( empty( $_POST['slicewp_token'] ) || ! wp_verify_nonce( $_POST['slicewp_token'], 'slicewp_register_affiliate' ) ) {
        return;
    }
	
	if ( is_user_logged_in() ) {
		return;
	}
	
	$notice="<p>This account already exists. Please firstly log into your account and then return to complete the registration.</p>";
	
	if ( ! empty( $_POST['user_login'] ) && username_exists( $_POST['user_login'] ) ) {
		slicewp_user_notices()->register_notice( 'user_login_exists_error', $notice, 'error' );
	}
	
	if ( email_exists( $_POST['user_email'] ) ) {
		slicewp_user_notices()->register_notice( 'user_email_exists_error', $notice, 'error' );
	}

}
add_action( 'slicewp_user_action_register_affiliate', 'slicewp_custom_user_action_register_affiliate_new_message', 60 );

Please copy the code and add it to your website. If you’re not sure how to add code snippets to your site, you can use the Code Snippets plugin ).

The code will modify the default error message with a custom one. Please make sure to change the “This account already exists. Please firstly log into your account and then return to complete the registration.” text from the code to whatever you’d like to appear as the error.

Please try it out and let me know how it goes.

Thank you and best wishes,

Mihai

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer