• Hello, I’m not super experienced with WordPress and I need to do a few things:

    • when a user registers himself he or she needs to get the role “lead” later an administrator should be able to add the role customer
    • the user profile page, should just present the user information and the option to change or delete it. Users shouldn’t see each others profile
    • i need to get the user role of the current user in javascript

    I have created the 2 roles “lead”, “customer”. I tried changing the default user page it was just a bunch of text fields. I made a test user, he got the role subscriber instead of lead..?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • i think you dont need a role, you need a tag, Lead and customer. its more simply to switch a tag instead of a role. do you have a CRM or Marketing automation system? if you have (check wpfusion)

    to set the default role to the recording you can go in the Forms of ultimate member, the registration form and change from there the default role of registration

    to display only the ACCOUNT page, just enter the registration link in the site menu, and set a redirect in the role settings after login.

    to block the profile page altogether you can modify the function.php file and insert this function by personalizing it

    function template_redirect_fn ()
    {
    if (is_page ('PAGE_NAME') && is_user_logged_in ())
    {
    $ username = wp_get_current_user ();
    $ redirectUrl = home_url ('YOURURLWITHOUThttp: //xxx.xx');
    
    wp_redirect ($ loginUrl);
    exit ();
    }
    
    }
    add_action ('template_redirect', 'template_redirect_fn', 30);
    • This reply was modified 5 years, 4 months ago by mredodos.
    Thread Starter extreme4all

    (@extreme4all)

    we do not have any users apart from the administrators yet.
    How can I give a user a tag with “ultimate member”, and can i get that tag?
    I could get user role with this: ( this is needed cause we need to send the role (or tag) to an application to give the users more rights)

    function get_current_user_role() {
      if( is_user_logged_in() ) {
        $user = wp_get_current_user();
        $role = ( array ) $user->roles;
        return $role[0];
      } else {
        return false;
      }
     }

    I only have default registration, login and profile page. the login and registration page are perfect but I don’t want that user upload a banner and picture etc. the user just has to be able to change their e-mail, name,… if they wish to do.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘user page & role’ is closed to new replies.