BP_Attachment_Cover_Image::__construct()

The constuctor.


Description Description


Source Source

File: bp-core/classes/class-bp-attachment-cover-image.php

	public function __construct() {
		// Allowed cover image types & upload size.
		$allowed_types        = bp_attachments_get_allowed_types( 'cover_image' );
		$max_upload_file_size = bp_attachments_get_max_upload_file_size( 'cover_image' );

		parent::__construct( array(
			'action'                => 'bp_cover_image_upload',
			'file_input'            => 'file',
			'original_max_filesize' => $max_upload_file_size,
			'base_dir'              => bp_attachments_uploads_dir_get( 'dir' ),
			'required_wp_files'     => array( 'file', 'image' ),

			// Specific errors for cover images.
			'upload_error_strings'  => array(
				11  => sprintf( __( 'That image is too big. Please upload one smaller than %s', 'buddypress' ), size_format( $max_upload_file_size ) ),
				12  => sprintf( _n( 'Please upload only this file type: %s.', 'Please upload only these file types: %s.', count( $allowed_types ), 'buddypress' ), self::get_cover_image_types( $allowed_types ) ),
			),
		) );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.4.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.