Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

Redirect Code

Simple Membership Plugin › Forums › Simple Membership Plugin › Redirect Code

Tagged: Redirect Code

  • This topic has 15 replies, 3 voices, and was last updated 10 years, 1 month ago by Myroslav.
Viewing 15 posts - 1 through 15 (of 16 total)
1 2 →
  • Author
    Posts
  • September 27, 2014 at 7:45 pm #358
    fmcmellon
    Participant

    Trying to set users “Home” link based on their Simple Membership Redirect. What code could I use to do this?

    September 28, 2014 at 2:55 am #361
    admin
    Keymaster

    Use the following addon so you can specify a “Welcome/Home Page” for each membership access level.

    https://simple-membership-plugin.com/configure-login-redirection-members/

    October 1, 2014 at 5:07 pm #385
    fmcmellon
    Participant

    I already have that installed. My question is what is the code that redirects them to their main landing page?

    The problem is the logo on our main website will bring them to the main home site. I want to have “home link” that redirects them to their main redirect

    October 1, 2014 at 11:46 pm #388
    admin
    Keymaster

    This addon probably won’t do what you are after. This addon basically redirects the user to a page AFTER they log in via the membership login page.

    October 3, 2014 at 2:14 am #390
    fmcmellon
    Participant

    If you provided the direction to what the actual redirect code is yes it could be easily added

    October 5, 2014 at 4:48 pm #395
    fmcmellon
    Participant

    Can anyone help?

    I am trying to add a link that will direct the logged in user back to their “homepage”

    It needs to call their login redirect page somehow?

    October 5, 2014 at 4:50 pm #397
    fmcmellon
    Participant

    a href="<?php echo wp_redirect($after_login_page_url = BMembershipLevelCustom::get_value_by_key($level_id, $key)); ?>" title="Login">Login</a

    October 7, 2014 at 3:34 pm #410
    fmcmellon
    Participant

    Support for this plugin sucks

    October 7, 2014 at 9:47 pm #414
    admin
    Keymaster

    The following should do:

    
    $auth = BAuth::get_instance();
    if ($auth->is_logged_in()) {
        $level = $auth->get('membership_level');
        $level_id = $level;
        $key = 'swpm_alr_after_login_page_field';
        $after_login_page_url = BMembershipLevelCustom::get_value_by_key($level_id, $key);
        echo '<a href="'.$after_login_page_url.'">Go to Welcome Page</a>';
    }
    
    October 8, 2014 at 4:17 am #416
    fmcmellon
    Participant

    Could you please show me how to use this as a link? When I do what you are saying I get the following

    $auth = BAuth::get_instance(); if ($auth->is_logged_in()) { $level = $auth->get('membership_level'); $level_id = $level; $key = 'swpm_alr_after_login_page_field'; $after_login_page_url = BMembershipLevelCustom::get_value_by_key($level_id, $key); echo 'Go to Welcome Page'; }

    That shows up on the page. The Go to Welcome Page is clickable however it brings me to a blank 404 page with sitename/membership-login/’.$after_login_page_url.’

    October 8, 2014 at 4:23 am #417
    fmcmellon
    Participant

    I am trying to figure out how to link the header image to bring you directly to your welcome page. Has no one asked this question?

    October 9, 2014 at 10:36 am #419
    admin
    Keymaster

    I don’t think you will be able to do that for the header image unfortunately.

    October 9, 2014 at 1:14 pm #420
    fmcmellon
    Participant

    Regardless the link you provided is incorrect and does not work

    May 1, 2016 at 11:56 pm #6796
    Myroslav
    Participant

    For guys who still have the same problem.

    This works for me:
    “>My Profile
    I put this into my widget but for that you should enable the opportunity to use php code in your widget area. Here’s the explanation : http://www.emanueleferonato.com/2011/04/11/executing-php-inside-a-wordpress-widget-without-any-plugin/

    Also you should follow the update documentation as in previous version the function was “swpm_after_login_url” and not “swpm_alr_after_login_url”.

    Hope this help anyone.

    May 1, 2016 at 11:58 pm #6797
    Myroslav
    Participant

    Oh my, it cleared it all.
    The example was:
    ““>My Profile“

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 16 total)
1 2 →
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy