BP_Attachment_Avatar::__construct()

Construct Upload parameters.

Description

See also

Source

File: bp-core/classes/class-bp-attachment-avatar.php

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
public function __construct() {
    // Allowed avatar types.
    $allowed_types = bp_core_get_allowed_avatar_types();
 
    parent::__construct( array(
        'action'                => 'bp_avatar_upload',
        'file_input'            => 'file',
        'original_max_filesize' => bp_core_avatar_original_max_filesize(),
 
        // Specific errors for avatars.
        'upload_error_strings'  => array(
            9  => sprintf( __( 'That photo is too big. Please upload one smaller than %s', 'buddyboss' ), size_format( bp_core_avatar_original_max_filesize() ) ),
            10 => sprintf( _n( 'Please upload only this file type: %s.', 'Please upload only these file types: %s.', count( $allowed_types ), 'buddyboss' ), self::get_avatar_types( $allowed_types ) ),
        ),
    ) );
}

Changelog

Changelog
Version Description
BuddyPress 2.3.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.