[ 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: 435 lines (13 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.

param: array $allowed_types Array of allowed avatar types.
since: 2.3.0
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.

param: array $file the temporary file attributes (before it has been moved).
since: 2.3.0
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.

param: string $file               The absolute path to the file.
param: int    $ui_available_width Available width for the UI.
since: 2.3.0
since: 2.4.0 Add the $ui_available_width parameter, to inform about the Avatar UI width.
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.

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

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

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

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 datas for the Uploader UI.

since: 2.3.0
return: array The javascript localization data.



Generated: Sun Nov 17 01:01:36 2019 Cross-referenced by PHPXref 0.7.1