[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

Core Avatars attachment class.

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

Defines 1 class

BP_Attachment_Avatar:: (10 methods):
  __construct()
  get_avatar_types()
  set_upload_dir()
  validate_upload()
  shrink()
  is_too_small()
  crop()
  get_user_id()
  get_group_id()
  script_data()


Class: BP_Attachment_Avatar  - X-Ref

BP Attachment Avatar class.

Extends BP Attachment to manage the avatar uploads.

__construct()   X-Ref
Construct Upload parameters.

since: 2.3.0

get_avatar_types( $allowed_types = array()   X-Ref
Gets the available avatar types.

since: 2.3.0
param: array $allowed_types Array of allowed avatar types.
return: string comma separated list of allowed avatar types.

set_upload_dir()   X-Ref
Set Upload Dir data for avatars.

since: 2.3.0

validate_upload( $file = array()   X-Ref
Avatar specific rules.

Adds an error if the avatar size or type don't match BuddyPress needs.
The error code is the index of $upload_error_strings.

since: 2.3.0
param: array $file the temporary file attributes (before it has been moved).
return: array the file with extra errors if needed.

shrink( $file = '', $ui_available_width = 0 )   X-Ref
Maybe shrink the attachment to fit maximum allowed width.

since: 2.3.0
since: 2.4.0 Add the $ui_available_width parameter, to inform about the Avatar UI width.
param: string $file               The absolute path to the file.
param: int    $ui_available_width Available width for the UI.
return: false|string|WP_Image_Editor|WP_Error

is_too_small( $file = '' )   X-Ref
Check if the image dimensions are smaller than full avatar dimensions.

since: 2.3.0
param: string $file the absolute path to the file.
return: bool

crop( $args = array()   X-Ref
Crop the avatar.

since: 2.3.0
param: array $args Array of arguments for the cropping.
return: array The cropped avatars (full, thumb and the timestamp).

get_user_id()   X-Ref
Get the user id to set its avatar.

since: 2.3.0
return: integer The user ID.

get_group_id()   X-Ref
Get the group id to set its avatar.

since: 2.3.0
return: integer The group ID.

script_data()   X-Ref
Build script data for the Uploader UI.

since: 2.3.0
return: array The javascript localization data.



Generated: Sun Apr 28 01:01:05 2024 Cross-referenced by PHPXref 0.7.1