[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/src/includes/users/ -> capabilities.php (summary)

bbPress User Capabilities Used to map user capabilities to WordPress's existing capabilities.

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

Defines 20 functions

  bbp_map_primary_meta_caps()
  bbp_set_user_role()
  bbp_get_user_role()
  bbp_get_user_blog_role()
  bbp_profile_update_role()
  bbp_is_valid_role()
  bbp_set_current_user_default_role()
  bbp_get_user_role_map()
  bbp_is_user_spammer()
  bbp_make_spam_user()
  bbp_make_ham_user()
  bbp_is_user_deleted()
  bbp_is_user_active()
  bbp_is_user_inactive()
  bbp_is_user_keymaster()
  bbp_user_has_profile()
  bbp_add_moderator()
  bbp_remove_moderator()
  bbp_get_moderator_ids()
  bbp_get_moderators()

Functions
Functions that are not part of a class:

bbp_map_primary_meta_caps( $caps = array()   X-Ref
Maps primary capabilities

since: 2.2.0 bbPress (r4242)
param: array  $caps Capabilities for meta capability.
param: string $cap Capability name.
param: int    $user_id User id.
param: array  $args Arguments.
return: array Actual capabilities for meta capability

bbp_set_user_role( $user_id = 0, $new_role = '' )   X-Ref
Set a user's role in the forums

since: 2.1.0 bbPress (r3860)
param: int $user_id
return: mixed False if no change. String of new role if changed.

bbp_get_user_role( $user_id = 0 )   X-Ref
Return a user's forums role

since: 2.1.0 bbPress (r3860)
param: int $user_id
return: string

bbp_get_user_blog_role( $user_id = 0 )   X-Ref
Return a user's blog role

since: 2.3.0 bbPress (r4446)
param: int $user_id
return: string

bbp_profile_update_role( $user_id = 0 )   X-Ref
Helper function hooked to 'bbp_profile_update' action to save or
update user roles and capabilities.

since: 2.2.0 bbPress (r4235)
param: int $user_id

bbp_is_valid_role( $role = '' )   X-Ref
Check if a role ID is valid

This helper function accepts a role ID as a string, and compares it against
the array of registered dynamic roles.

Use this function anytime you are manually attempting to set a user role
without using the bbp_set_user_role() function, or if you need to halt
additional processing during role validation.

since: 2.6.5
param: string $role A well-formed (string) role ID to validate
return: bool True if role is valid. False if role is not valid.

bbp_set_current_user_default_role()   X-Ref
Add the default role to the current user if needed

This function will bail if the forum is not global in a multisite
installation of WordPress, or if the user is marked as spam or deleted.

since: 2.0.0 bbPress (r3380)
return: If not multisite, not global, or user is deleted/spammed

bbp_get_user_role_map()   X-Ref
Return a map of WordPress roles to bbPress roles. Used to automatically grant
appropriate bbPress roles to WordPress users that wouldn't already have a
role in the forums. Also guarantees WordPress admins get the Keymaster role.

since: 2.2.0 bbPress (r4334)
return: array Filtered array of WordPress roles to bbPress roles

bbp_is_user_spammer( $user_id = 0 )   X-Ref
Checks if the user has been marked as a spammer.

since: 2.0.0 bbPress (r3355)
param: int $user_id int The ID for the user.
return: bool True if spammer, False if not.

bbp_make_spam_user( $user_id = 0 )   X-Ref
Mark a users topics and replies as spam when the user is marked as spam

since: 2.0.0 bbPress (r3405)
param: int $user_id Optional. User ID to spam. Defaults to displayed user.
return: bool If no user ID passed.

bbp_make_ham_user( $user_id = 0 )   X-Ref
Mark a users topics and replies as spam when the user is marked as spam

since: 2.0.0 bbPress (r3405)
param: int $user_id Optional. User ID to unspam. Defaults to displayed user.
return: bool If no user ID passed.

bbp_is_user_deleted( $user_id = 0 )   X-Ref
Checks if the user has been marked as deleted.

since: 2.0.0 bbPress (r3355)
param: int $user_id int The ID for the user.
return: bool True if deleted, False if not.

bbp_is_user_active( $user_id = 0 )   X-Ref
Checks if user is active

since: 2.0.0 bbPress (r3502)
param: int $user_id The user ID to check
return: bool True if public, false if not

bbp_is_user_inactive( $user_id = 0 )   X-Ref
Checks if user is not active.

since: 2.0.0 bbPress (r3502)
param: int $user_id The user ID to check. Defaults to current user ID
return: bool True if inactive, false if active

bbp_is_user_keymaster( $user_id = 0 )   X-Ref
Checks if user is a keymaster

since: 2.3.0 bbPress (r4783)
param: int $user_id
return: bool True if keymaster, false if not

bbp_user_has_profile( $user_id = 0 )   X-Ref
Does a user have a profile for the current site

since: 2.2.0 bbPress (r4362)
param: int $user_id User ID to check
return: bool Whether or not the user has a profile on this blog_id.

bbp_add_moderator( $object_id = 0, $user_id = 0, $object_type = 'post' )   X-Ref
Add a moderator to an object

since: 2.6.0 bbPress (r6056)
param: int    $object_id   Traditionally a post ID
param: int    $user_id     User ID
param: string $object_type Type of meta (post,term,user,comment)
return: bool

bbp_remove_moderator( $object_id = 0, $user_id = 0, $object_type = 'post' )   X-Ref
Remove a moderator user ID from an object

since: 2.6.0 bbPress (r6056)
param: int    $object_id   Traditionally a post ID
param: int    $user_id     User ID
param: string $object_type Type of meta (post,term,user,comment)
return: bool

bbp_get_moderator_ids( $object_id = 0, $object_type = 'post' )   X-Ref
Get user IDs of moderators for an object

since: 2.6.0 bbPress (r6056)
param: int    $object_id   Traditionally a post ID
param: string $object_type Type of meta (post,term,user,comment)
return: array

bbp_get_moderators( $object_id = 0, $object_type = 'post' )   X-Ref
Get moderators for a specific object ID. Will return global moderators when
object ID is empty.

since: 2.6.0 bbPress (r6056)
param: int    $object_id   Traditionally a post ID
param: string $object_type Type of meta (post,term,user,comment)
return: array



Generated: Fri Dec 4 01:01:48 2020 Cross-referenced by PHPXref 0.7.1