[ Index ]

PHP Cross Reference of BackPress

title

Body

[close]

/includes/ -> class.bp-user.php (summary)

(no description)

File Size: 402 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

BP_User:: (13 methods):
  __construct()
  BP_User()
  _init_caps()
  get_role_caps()
  add_role()
  remove_role()
  set_role()
  update_user()
  add_cap()
  remove_cap()
  remove_all_caps()
  has_cap()
  translate_level_to_cap()


Class: BP_User  - X-Ref

BackPress User class.

__construct( $id, $name = '' )   X-Ref
PHP4 Constructor - Sets up the object properties.

Retrieves the userdata and then assigns all of the data keys to direct
properties of the object. Calls {@link BP_User::_init_caps()} after
setting up the object's user data properties.

since: 2.0.0
return: BP_User
param: int|string $id User's ID or username
param: int $name Optional. User's username

BP_User( $id, $name = '' )   X-Ref
No description

_init_caps()   X-Ref
Setup capability object properties.

Will set the value for the 'cap_key' property to current database table
prefix, followed by 'capabilities'. Will then check to see if the
property matching the 'cap_key' exists and is an array. If so, it will be
used.

since: 2.1.0

get_role_caps()   X-Ref
Retrieve all of the role capabilities and merge with individual capabilities.

All of the capabilities of the roles the user belongs to are merged with
the users individual roles. This also means that the user can be denied
specific roles that their role might have, but the specific user isn't
granted permission to.

since: 2.0.0

add_role( $role )   X-Ref
Add role to user.

Updates the user's meta data option with capabilities and roles.

since: 2.0.0
param: string $role Role name.

remove_role( $role )   X-Ref
Remove role from user.

since: 2.0.0
param: string $role Role name.

set_role( $role )   X-Ref
Set the role of the user.

This will remove the previous roles of the user and assign the user the
new one. You can set the role to an empty string and it will remove all
of the roles from the user.

since: 2.0.0
param: string $role Role name.

update_user()   X-Ref
No description

add_cap( $cap, $grant = true )   X-Ref
Add capability and grant or deny access to capability.

since: 2.0.0
param: string $cap Capability name.
param: bool $grant Whether to grant capability to user.

remove_cap( $cap )   X-Ref
Remove capability from user.

since: 2.0.0
param: string $cap Capability name.

remove_all_caps()   X-Ref
Remove all of the capabilities of the user.

since: 2.1.0

has_cap( $cap )   X-Ref
Whether user has capability or role name.

This is useful for looking up whether the user has a specific role
assigned to the user. The second optional parameter can also be used to
check for capabilities against a specfic post.

since: 2.0.0
return: bool True, if user has capability; false, if user does not have capability.
param: string|int $cap Capability or role name to search.
param: int $post_id Optional. Post ID to check capability against specific post.

translate_level_to_cap( $level )   X-Ref
Convert numeric level to level capability name.

Prepends 'level_' to level number.

since: 2.0.0
return: string
param: int $level Level number, 1 to 10.



Generated: Fri Dec 6 01:00:55 2024 Cross-referenced by PHPXref 0.7.1