• When logged out, there’s a “Log In” and a “Register” link. The first shows a login form in a popup, the second does nothing – but the “Create an account” within the Login form does produce the Register” form (and works – I tested creating a new user).

    I haven’t looked at the code yet, but this should be an easy fix.

    https://wordpress.org/plugins/simple-ajax-auth/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter marjoleink

    (@marjoleink)

    Looking through the code, I already found the problem, I think:

    In the file plugin.php, function simple_ajax_auth_register_link() is missing a closing <a/> tag; it should be (line 160 etc.):

    function simple_ajax_auth_register_link( $before = '', $after = '' ) {
            $setup = get_option('simpleajaxauth');
            return ( ! is_user_logged_in() && get_option( 'users_can_register' )) ? ( $before . '<a id="show_register">' . ( isEmpty($setup['register_text']) ? 'Register' : $setup['login_text'] ) . '<a/>' . $after ) : '';
    }

    Untested, but I think the missing end tag is preventing jQuery from recognizing the link.

    Thread Starter marjoleink

    (@marjoleink)

    That was not a complete solution… The link inside the login form has id pop_signup, while the link on the widget has id show_register. The jQuery looks for respectively (#pop_login, #pop_signup) and (#show_login, #show_signup).

    So, if we change the id in the function that generates the link to show_signup, it starts working:

    function simple_ajax_auth_register_link( $before = '', $after = '' ) {
            $setup = get_option('simpleajaxauth');
            return ( ! is_user_logged_in() && get_option( 'users_can_register' )) ? ( $before . '<a id="show_signup">' . ( isEmpty($setup['register_text']) ? 'Register' : $setup['login_text'] ) . '<a/>' . $after ) : '';
    }

    That’s more consistent, too.

    You can mark this as resolved. 🙂

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

The topic ‘Register link doesn't work.’ is closed to new replies.