hooks()
hooks() : mixed
Class Users
map_caps_by_role(bool[] $allcaps, string[] $caps, array $args) : bool[]
Restrict the edit/delete users via wp-admin screen due UM role capabilities
| bool[] | $allcaps | Array of key/value pairs where keys represent a capability name and boolean values represent whether the user has that capability. |
| string[] | $caps | Required primitive capabilities for the requested capability. |
| array | $args | { Arguments that accompany the requested capability check.
} |
can_be_set_as_pending(int $user_id, bool $force = false) : bool
Check if the user can be set as pending admin review. Cannot set the same status but any user can be set to pending admin review.
| int | $user_id | User ID. |
| bool | $force | If true - ignore current user condition. |
approve(int $user_id, bool $force = false, bool $silent = false) : bool
Approve user.
| int | $user_id | User ID. |
| bool | $force | If true - ignore current user condition. |
| bool | $silent | If true - don't send email notification. E.g. case when user already exists, but doesn't have a status. |
true if the user has been approved
false on failure or if the user already has approved status.
can_view_user(int $user_id, int|null $current_user = null) : bool
Check if the current user can view a specific user.
| int | $user_id | The user ID to check if you can view |
| int|null | $current_user | The ID of the current user. Default is null. |
True if the user can be viewed, false otherwise
get_privacy_setting(int $user_id) : string|bool
Retrieve the privacy setting for a user's profile.
| int | $user_id | The ID of the user whose privacy setting is to be retrieved. |
The privacy setting of the user's profile, or false if the user cannot access private profile functionality.
get_restricted_privacy_notice(int $user_id) : string|null
Retrieves the restricted privacy notice for a user's profile based on their privacy settings.
| int | $user_id | The ID of the user whose profile privacy is being checked. |
Returns the restricted privacy notice text if the profile is private, or null if the profile is not private.
can_view_private_user_profile(int $user_id, int|null $current_user = null) : bool
Check if the current user can view a private user profile
| int | $user_id | The ID of the user profile to check |
| int|null | $current_user | Optional current user ID, defaults to current logged-in user |
Whether the current user can view the private user profile
can_view_user_profile(int $user_id, int|null $current_user = null) : bool
Determine if the current user can view a specific user's profile.
| int | $user_id | User ID of the profile being viewed. |
| int|null | $current_user | ID of the current user viewing the profile. |
Whether the current user can view the user's profile.