[ Index ]

PHP Cross Reference of BuddyPress




/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):

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.

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

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.

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

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

return: false|string|WP_Image_Editor|WP_Error
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.

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

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

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

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

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

return: integer The user ID.
since: 2.3.0

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

return: integer The group ID.
since: 2.3.0

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

return: array The javascript localization data.
since: 2.3.0

Generated: Sun Feb 25 01:01:00 2024 Cross-referenced by PHPXref 0.7.1