Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter 0260n4s

    (@0260n4s)

    Thanks for all your help, Kevin. I did use the latest version of the code, so it must just be the theme customization that’s not playing nice. At least the registration link works, and with the other code, new users can manually activate. So I think I’ll be able to work around the limitation for the time being. But again, I really appreciate all the personal attention you’ve given my question. I posted a 5-star review for the plugin on WordPress.

    Thread Starter 0260n4s

    (@0260n4s)

    Thank you for your reply and help, but unfortunately, it didn’t work.

    The Register link worked and allowed me to register an account, but the activation link still redirected to the login page without activation. That was true if I used the full activation link or tried to just go to …/activate/.

    Thread Starter 0260n4s

    (@0260n4s)

    Thank you for your reply. The wp_registration_url suggestion went over my head, I’m afraid. I wouldn’t know how to adapt it specifically to my site. Totally new at this game.

    I’m using the OceanWP theme, so perhaps that theme is forcing a custom registration URL(?) I didn’t realize themes even did that. I haven’t set anything up myself directly.

    All I know is the register link went to …/register/ and if anyone clicked it, they were redirected to the login page. Once I whitelisted /register/ it worked. Likewise, the activation URL is …/activate/[random key], so I whitelisted /activate/ and I can at least manually enter the activation key to activate, but no confirmation page.

    Is the code problematic to use as a workaround? Because, frankly, I’m completely out of options myself. If I can’t use that code, I can’t use force login; people need to get into the site, but I don’t want anyone except registered users getting in.

    Sorry I’m such a noob. I’m the only one working on this before we open a virtual camp on Friday, and with the virus, funding for a programmer is unfortunately not an option.

    Thread Starter 0260n4s

    (@0260n4s)

    I’m making some progress. I replaced the previous code with:
    —–
    /**
    * Filter Force Login to allow exceptions for specific URLs.
    *
    * @return array An array of URLs. Must be absolute.
    **/
    function my_forcelogin_whitelist( $whitelist ) {
    // list of single page URLs
    $whitelist[] = site_url( ‘/register/’ );
    $whitelist[] = site_url( ‘/activate/’ );

    // if current page matches conditional tag, add to whitelist
    if ( is_home() || is_sticky() ) {
    $whitelist[] = site_url($_SERVER[‘REQUEST_URI’]);
    }

    return $whitelist;
    }
    add_filter(‘v_forcelogin_whitelist’, ‘my_forcelogin_whitelist’, 10, 1);
    —–

    The activation link still won’t work directly, possibly because Force Login is reading the activation key (blah.com/activate/randomcharacters/) as another subdirectory. BUT, I can go directly to the activation page and manually enter the activation key. It won’t display a confirmation page and instead redirects me to login, but it does activate the account.

    Does anyone know how to make the link work like it’s supposed to and have a confirmation page?

    Any chance of posting the solution? I have the same problem.

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