• Resolved aaron13223

    (@aaron13223)


    Hi There,

    When a user registers via Social Login, they see a confirmation form with the privacy text and at the top, there is a message/alert that says “Register For This Site”.

    I would like to edit/disable the text of this. What would you suggest is the best way of going about this?

    Ideally, there could be a filter on this but it does not exist at the moment. It wouldn’t make sense to edit this string directly in includes/userData.php – displayForm()

    Let me know what you think. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Robert

    (@robertnextendweb)

    Hi @aaron13223

    You can end up on that form if we have to ask for information from the user. Such as accepting the Privacy Policy / Terms of Conditions, or asking for extra fields, like username, password and email from the user.

    I assume you mean the form where the Privacy Policy string is shown. If you would like to remove this, you can go to the Privacy tab:
    https://nextendweb.com/nextend-social-login-docs/global-settings-privacy/
    and disable the “Terms and conditions – Show” option. This will not show the form, so the user will be registered directly without seeing that.

    Or if you want to keep the form, and would like to change/get rid of the text itself, then you can override this with a custom code or a custom translation file, but please note that we cannot help with custom coding.

    Or if you don’t want it to be asked on the WordPress default login form ( /wp-login.php ), then you could create a new page, add this shortcode into it:

    [nextend_social_login_register_flow]

    then save the page, and select it for our Page for Register Flow setting on our General tab:
    https://nextendweb.com/nextend-social-login-docs/global-settings/
    this way that form would be rendered rather with the template of the selected page.

    Thread Starter aaron13223

    (@aaron13223)

    Hi Robert,

    I hope you are doing well and thanks so much for getting back so quickly.

    I talked about the privacy part so it’s easier to identify what form I was talking out.

    The one I am talking about in particular is the one the one users reach if they try to login in via their social account but do not have an account yet. So they see the “Register” form in that case.

    What I want to edit/disable is the Message/Notice that shows up at the top of the form with the text “Register For This Site”

    That notice is added via the function displayForm() in the class NextendSocialUserData inside the file includes/userdata.php.

    The notice is being added on line 156 with this code:

    login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $this->errors);

    I also understand if you guys cannot help with custom coding, no issues with that:)

    I just thought it would better to reach out to you guys to hear your thoughts about what could be a good solution to this.

    I will see what I can do with the translation file. Let me know what you think and I really appreciate your help on this. Thanks again!

    Thread Starter aaron13223

    (@aaron13223)

    Adding this in case someone ever needs it in the future:

    function modify_nextend_register_message($translated_text, $text, $domain) {
    if ($text === 'Register For This Site') {
    return 'Custom message';
    }
    return $translated_text;
    }
    add_filter('gettext', 'modify_nextend_register_message', 20, 3);
    Plugin Support Laszlo

    (@laszloszalvak)

    Hi @aaron13223

    I am glad you managed to find a workaround.

    Just an additional tip regarding the login header text:
    When we handle the registration flow over the /wp-login.php form, we try to make it look the same as the WordPress default register form does. So we also add this “Register For This Site” text via the login_header() function.

    The login_header() function has the “login_message” filter:

    to modify the text, that is passed over its 2nd parameter. So you could modify that text for all login_header() over that filter. Or if you want to modify it only in the register flow of Nextend Social Login, then you could hook your filtering code to the “nsl_before_register” action. As my colleague mentioned, custom coding is out of the scope of our support but I created a basic example for you so you will see what I meant:

        add_action('nsl_before_register', function(){
    add_filter('login_message', function($message){
    return wp_get_admin_notice(
    __( 'Your custom text here' ),
    array(
    'type' => 'info',
    'additional_classes' => array( 'message', 'register' ),
    )
    );
    });
    });

    You could also, wrap the text with your own text domain, if you want to translate the text.

    Best regards,
    Laszlo.

    Thread Starter aaron13223

    (@aaron13223)

    Hi Laszlo,

    Thanks so much for this! That is definitely a much more efficient approach. You guys are awesome 😉

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Edit/Disable Register Notice/Message’ is closed to new replies.