learndash_shortcode_protect_user( int $user_id )
Protects a user ID from being accessed by other users.
Description #
Parameters #
- $user_id
-
(int) (Required) User ID.
Return #
(int) The user ID.
Source #
Changelog #
Version | Description |
---|---|
4.11.0 | Introduced. If the current user is not logged in, then the user ID is set to 0. If the current user is an admin, then they can access any user. If the current user is a group leader, then they can only access users in their group. If the current user is not an admin or group leader, then they can only access themselves. Otherwise, the user ID is set to 0. |