我正在使用drupal 7 profile2 模块用于创建用户配置文件和组管理组件的有机组模块。
我在用户配置文件中有用户状态字段，有两个选项（单选按钮），用于概要字段的可见性，如 1。在组 2中可见。看不见。
I am using Drupal 7 profile2 module for creating user profile and Organic group module for group managemnet.
I have user status field in user profile, and there are two options(radio button) for visibility of profile field like 1. Visible in Group 2. Invisible.
Visible in Group is selected then any group member can see the user status
Invisible then no one can see the user status field
Now I want to know that is there any way to unset the profile field during viewing. Is any hook calling during user view event ?
I have also the code that checks whether user being viewed and logged in user are member of same group or not
hook_entity_view can be used all core and most contrib entities and the more specific
hook_user_view can be used when the user account is used - this is, however, not the same as the user profile itself.
You should note that this wont effect fields and entities displayed by views.