[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/classes/ -> class-bp-core-user.php (summary)

Core component classes.

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

Defines 1 class

BP_Core_User:: (13 methods):
  __construct()
  populate()
  populate_extras()
  get_profile_data()
  get_users()
  get_users_by_letter()
  get_specific_users()
  search_users()
  get_user_extras()
  get_core_userdata()
  get_last_activity()
  update_last_activity()
  delete_last_activity()


Class: BP_Core_User  - X-Ref

Fetch data about a BuddyPress user.

BP_Core_User class can be used by any component. It will fetch useful
details for any user when provided with a user_id.

Example:
$user = new BP_Core_User( $user_id );
$user_avatar = $user->avatar;
$user_email = $user->email;
$user_status = $user->status;
etc.
__construct( $user_id, $populate_extras = false )   X-Ref
Class constructor.

param: integer $user_id         The ID for the user being queried.
param: bool    $populate_extras Whether to fetch extra information such as

populate()   X-Ref
Populate the instantiated class with data based on the User ID provided.


populate_extras()   X-Ref
Populates extra fields such as group and friendship counts.


get_profile_data()   X-Ref
Fetch xprofile data for the current user.

return: array See {@link BP_XProfile_Profile_Data::get_all_for_user()}.

get_users( $type, $limit = 0, $page = 1, $user_id = 0, $include = false, $search_terms = false, $populate_extras = true, $exclude = false, $meta_key = false, $meta_value = false )   X-Ref
Get a list of users that match the query parameters.

Since BuddyPress 1.7, use {@link BP_User_Query} instead.

return: false|array {
param: string      $type            See {@link BP_User_Query}.
param: int         $limit           See {@link BP_User_Query}. Default: 0.
param: int         $page            See {@link BP_User_Query}. Default: 1.
param: int         $user_id         See {@link BP_User_Query}. Default: 0.
param: mixed       $include         See {@link BP_User_Query}. Default: false.
param: string|bool $search_terms    See {@link BP_User_Query}.
param: bool        $populate_extras See {@link BP_User_Query}.
param: mixed       $exclude         See {@link BP_User_Query}. Default: false.
param: string|bool $meta_key        See {@link BP_User_Query}.
param: string|bool $meta_value      See {@link BP_User_Query}.

get_users_by_letter( $letter, $limit = null, $page = 1, $populate_extras = true, $exclude = '' )   X-Ref
Fetch the details for all users whose usernames start with the given letter.

return: false|array False on error, otherwise associative array of results.
param: string   $letter          The letter the users names are to start with.
param: int|null $limit           The number of users we wish to retrive.
param: int      $page            The page number we are currently on, used in conjunction
param: bool     $populate_extras If we should populate extra user fields.
param: string   $exclude         Comma-separated IDs of users whose results

get_specific_users( $user_ids, $limit = null, $page = 1, $populate_extras = true )   X-Ref
Get details of specific users from the database.

Use {@link BP_User_Query} with the 'user_ids' param instead.

return: array Associative array.
param: array    $user_ids        The user IDs of the users who we wish to
param: int|null $limit           The limit of results we want.
param: int      $page            The page we are on for pagination.
param: bool     $populate_extras If we should populate extra user fields.

search_users( $search_terms, $limit = null, $page = 1, $populate_extras = true )   X-Ref
Find users who match on the value of an xprofile data.

return: array Associative array.
param: string   $search_terms    The terms to search the profile table
param: int|null $limit           The limit of results we want.
param: int      $page            The page we are on for pagination.
param: boolean  $populate_extras If we should populate extra user fields.

get_user_extras( &$paged_users, &$user_ids, $type = false )   X-Ref
Fetch extra user information, such as friend count and last profile update message.

Accepts multiple user IDs to fetch data for.

return: mixed False on error, otherwise associative array of results.
param: array       $paged_users An array of stdClass containing the users.
param: string      $user_ids    The user ids to select information about.
param: string|bool $type        The type of fields we wish to get.

get_core_userdata( $user_id )   X-Ref
Get WordPress user details for a specified user.

return: false|object WP_User if successful, false on failure.
param: int $user_id User ID.
since: 3.0.0 Results might be from cache

get_last_activity( $user_id )   X-Ref
Get last activity data for a user or set of users.

return: false|array
param: int|array $user_id User IDs or multiple user IDs.

update_last_activity( $user_id, $time )   X-Ref
Set a user's last_activity value.

Will create a new entry if it does not exist. Otherwise updates the
existing entry.

return: bool True on success, false on failure.
param: int    $user_id ID of the user whose last_activity you are updating.
param: string $time    MySQL-formatted time string.
since: 2.0.0

delete_last_activity( $user_id )   X-Ref
Delete a user's last_activity value.

return: bool True on success, false on failure or if no last_activity
param: int $user_id ID of the user whose activity should be deleted.
since: 2.0.0



Generated: Thu Nov 21 01:00:57 2024 Cross-referenced by PHPXref 0.7.1