WordPress.org

Ready to get started?Download WordPress

Forums

Paid Memberships Pro
Fixing the redirect in PMP with PMP Network? (4 posts)

  1. foxymcfox
    Member
    Posted 1 year ago #

    While sandboxing my site, I noticed that every time a member tried to log in to a subdomain, they were redirected to the member levels page and asked to create a site. (In my site, one person pays for a subdomain to be created and then people sign up for their specific subdomain for free)

    The bit of code that's doing this is in the root PHP file of the Paid Memberships Pro plugin, and is as follows:

    elseif($wpdb->get_var("SELECT membership_id FROM $wpdb->pmpro_memberships_users WHERE status = 'active' AND user_id = '" . $user->ID . "' LIMIT 1"))
    		{
    			//if logged in and a member, send to wherever they were going
    		}
    		else
    		{
    			//not a member, send to subscription page
    			$redirect_to = pmpro_url("levels");
    		}

    In essence, because my members are ONLY members of the subdomain, and not "members" as defined by the plugin, they are being asked to create a site and pay.

    What I'd like to do is replace the $redirect_to = pmpro_url("levels"); section with a redirect that would send the users to the subdomain they were signing into. I've tried replacing "pmppro_url()" with both "site_url()" and "network_site_url()" (among many others) and both send users back to the root domain upon signing in instead of to the subdomain.

    Thoughts on what other functions or variables I might be able to use? This is the only minor issue I'm having with this incredible plugin and I'm sure there has to be a fairly simple solution.

    Thanks!

    -Nick

    EDIT: Just for additional information, part of the problem, I believe, is that the plugin is only activated on the root domain, NOT THE SUBDOMAINS, so any attempt to use the standard hooks like "get_network_url" or the like are most likely pulling from the apparent directory of the plugin. I need it to recognize the referring site and send the users back there upon login.

    http://wordpress.org/extend/plugins/paid-memberships-pro/

  2. strangerstudios
    Member
    Plugin Author

    Posted 1 year ago #

    Foxy, thanks for signing up for support at http://www.paidmembershipspro.com. After working through the problem there, I will post a quick update here for people who might have run into the same issue.

    Thanks.

  3. kings3jm
    Member
    Posted 1 year ago #

    Was there ever a fix to this? My non-members who are simply "subscribers" are annoyed at this redirect every time they log in and I'd like to change it.

    Thanks!

  4. strangerstudios
    Member
    Plugin Author

    Posted 1 year ago #

    Kings, not exactly, but there should be soon. Stay tuned to the pmpro-network code for updates.

    https://github.com/strangerstudios/pmpro-network

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic