Skip to:
Content
Pages
Categories
Search
Top
Bottom

Redirecting profile nav tab to a different tab/link


  • supportalgos
    Participant

    @supportalgos

    If the user is subscribed to one of the three memberships, they have access to the visitors profile tab (www.site.com/members/user/visitors) but if they are not subscribed, if they click on the visitors profile tab they shouldn’t be allowed to access it and should instead be redirected to a different tab called Premium (www.site.com/members/user/premium).

       if(current_user_can('memberpress_product_authorized_853' || 'memberpress_product_authorized_1007' || 'memberpress_product_authorized_1008')) {
      // Do authorized only stuff here
    }
    else {
      // Do unauthorized stuff here
        
        if( bp_get_requested_url() == (bbp_get_user_profile_url() . "/visitors")) {
            function visitors_redirect() { 
             bp_core_redirect( bbp_get_user_profile_url() . "/premium");
        }
        
    
    }
    
        add_action('visitors_redirect');
    
    }

    However, using this code, the site goes into some form of maintenance mode and gives me the error: “There has been a critical error on this website”.

  • You must be logged in to reply to this topic.
Skip to toolbar