• Pete

    (@perthmetro)


    Ultimate Member has a bug whereby a profile owner with user-role XYZ can’t hide individual fields of their profile from other members of the same user-role as the profile owner without blocking themselves from editing their own profile as well. This is an ugly/temporary fix (the profile owner still can’t view their profile field, but at least they can edit it).

    Firstly, add this to your functions.php…

    add_filter('body_class','add_role_to_body');
    function add_role_to_body($classes) {
        $current_user = new WP_User(get_current_user_id());
        $user_role = array_shift($current_user->roles);
        $classes[] = 'role-'. $user_role;
        return $classes;
    }

    Secondly, add this css…
    .role-XYZ .um-viewing .um-field-YOUR_SPECIFIC_USER_PROFILE_FIELD {display:none;}

    https://wordpress.org/plugins/ultimate-member/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Ultimate Member

    (@ultimatemember)

    Thanks for sharing. We will try change this functionality in a future update to plugin. πŸ™‚

    Thread Starter Pete

    (@perthmetro)

    I think it’s a bug rather than a lack of functionality, I can’t see any reason why you’d stop a user from editing their own profile just because they want to stop other members from the same user role from viewing them. I’ve looked into the code and unfortunately you’ve used the “editability” of a profile as a means to determine the “visibility” of a profile. These two, edit and view need to be separated.

    Plugin Author Ultimate Member

    (@ultimatemember)

    Sorry, I didn’t understand your point of view, can you send us a ticket with further explaination?

    Thanks!

    Thread Starter Pete

    (@perthmetro)

    I’ve spoken to death about it in the old support forum, there’s even another chap who had the exact same problem as me. Calum said he understood the issue and would bring it up with “the team”. On confirming this sometime later he admitted he didn’t bring up as he was too busy. I haven’t heard any more so I presume it’s not on the foreseeable agenda. Have a scan on the forum about this topic or talk to Calum.

    Plugin Author Ultimate Member

    (@ultimatemember)

    I’ll ask him. Thanks for replying to me!

    Thread Starter Pete

    (@perthmetro)

    I assumed you UM people know what I was on about when you replied above “Thanks for sharing. We will try change this functionality in a future update to plugin. :)” Strange that you’re looking for clarification now?

    https://ultimatemember.com/forums/topic/field-privacy-needs-profile-owner-option-in-specific-member-roles/

    https://ultimatemember.com/forums/topic/privacy-visible-to-profile-owner-and-specific-member-roles/

    It sounds like you guys need to update your Trello issue/bug board as there’s a heap of issues that have been lost with “We’ll discuss it with the team”. By all means discuss it but you need a transparent means to keep these bugs/issues in the open for all to see. Hiding behind a closed ticket system has lowered my confidence in this plugin and that you guys have got you stuff sorted.

    Plugin Author Ultimate Member

    (@ultimatemember)

    Calum here. We would have liked to have continued providing support via forum (that is why we chose that method in first place) but it simply became unmanageable i.e difficult to keep track of open tickets, assign tickets etc.

    We didn’t make this decision to hide, we needed a support system that is efficient and works well when growing a team. Unfortunately it became clear with the amount of topics being created that the forum would not be suitable any longer which is why like many other WP plugin businesses we have moved from a forum to providing support via HelpScout.

    I hadn’t had a chance to bring this up but I agree with the issue at hand here. It makes sense that the user editing their profile should still be able to edit the field if their role is not allowed to vie the field on the profile form.

    We will try add it in.

    Thanks!

    Thread Starter Pete

    (@perthmetro)

    Thanks Calum.

    This css hides the complete user’s field layout, this way you won’t have to find the css for each individual field. Again, even though the user can’t see their own profile, other user roles (other than role ‘xyz’) can BUT users can still see their fields when they edit them.

    .role-xyz.um-viewing .um-form .um-profile-body.main.main-default {display:none;}

    I absolutely understand the concept of tracking issues, but I just disagree with it being closed. As it is closed, I strongly believe you should be making a concerted effort to keeping a very active and accurate up to date bug/feature/todo list. As it is now the ONLY way the public can get an idea on what is happening with UM is this forum. Trello appears abandoned and we have no idea what bugs or features you have “prioritised”. “We will try add it in” just doesn’t cut it when it comes to instilling confidence in a consumer thinking of spending money on your product.

    Plugin Author Ultimate Member

    (@ultimatemember)

    Yep I fully get the benefits of the forum. We tried to keep it going as long as possible but it just became completely unmanagable. The initial idea with the forum was for it to be community led like WP is supported by the users but in reality it turned out to be like 95% just support requests so we had to make the switch to make providing support as efficient as possible.

    I’m going to have a think about ways to allow community to continue chatting (beyond this forum).

    Fully understand, I would only purchase a product if I was happy with the offering. So hopefully in near future you will feel in a position to do so.

    Thanks!

    Thread Starter Pete

    (@perthmetro)

    Any reason why this hasn’t been fixed yet?

    Plugin Author Ultimate Member

    (@ultimatemember)

    I believe you are referring to the new privacy option we just added into plugin which allows admin to make a field only viewable to specific user roles and profile owner. Have you tried out this new privacy option yet?

    Thread Starter Pete

    (@perthmetro)

    Plugin Author Ultimate Member

    (@ultimatemember)

    Yes it does πŸ™‚

    Thread Starter Pete

    (@perthmetro)

    Whoo hoo… Ultimate Member, we’re back in business!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘How to hide user profile fields from members of the same user role’ is closed to new replies.