Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

Dashboard Redirect

WCMp Advanced Frontend Manager

Resolved
Viewing 3 reply threads
  • Author
    Posts
    • #127742
      DragNfLy
      Participant

      Hi,

      Can you please assist with some code to redirect some user roles trying to access the ‘dashboard’ page to the ‘account’ page.

      I have tried the following code but it somehow does not work.
      I must be doing something wrong or is there a better way of doing this?

      // REDIRECT SUBSCRIBER, PAID SUBSCRIBER, CUSTOMER AND REJECTED VENDOR IF TRYING TO ACCESS DASHBOARD
      add_action(‘template_redirect’, ‘redirect_user_role’);
      function redirect_user_role(){
      if(is_user_logged_in() && current_user_can( ‘subscriber’ ) || current_user_can( ‘paid_subscriber’ ) || current_user_can( ‘dc_rejected_vendor’ ) || current_user_can( ‘customer’ ) && is_page(‘dashboard’)) {
      wp_redirect(‘account’);
      } }

      Assistance much appreciated.

      Kind regards,
      Dale

    • #127754

      Hi,
      Use below code

      add_action('template_redirect', 'redirect_user_role',100000);
      function redirect_user_role(){
          if(is_user_logged_in() && current_user_can( 'subscriber' ) || current_user_can( 'paid_subscriber' ) || current_user_can( 'dc_rejected_vendor' ) || current_user_can( 'customer' ) && is_page('dashboard')) {
              wp_safe_redirect('my-account');
              exit;
          } 
      }
      Copy

      Regards,

    • #128533
      timestweb
      Participant

      Hello support, I am having issues with the vendor registration form.

      I already setup at the backend as an admin doesn’t need to approve any vendor.

      If a user sign up as a vendor for the first time. It doesn’t redirect to setup the dashboard wizard instead drop a Thank you message.

      When I checked as an administrator at the backend.. I will always seen the user role as subscriber. Please help fix with a code

      I just want the vendor to register and redirect directly to the vendor dashboard.

    • #128578

      Hi, timestweb.
      Our team has responded you over email. Kindly check your mailbox.

Viewing 3 reply threads

The topic ‘Dashboard Redirect’ is closed to new replies.