Changeset 9831 for trunk/src/bp-core/classes/class-bp-attachment-avatar.php
- Timestamp:
- 05/02/2015 08:55:07 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-attachment-avatar.php
r9819 r9831 29 29 */ 30 30 public function __construct() { 31 // Allowed avatar types 32 $allowed_types = bp_core_get_allowed_avatar_types(); 33 31 34 parent::__construct( array( 32 35 'action' => 'bp_avatar_upload', … … 37 40 'upload_error_strings' => array( 38 41 9 => sprintf( __( 'That photo is too big. Please upload one smaller than %s', 'buddypress' ), size_format( bp_core_avatar_original_max_filesize() ) ), 39 10 => __( 'Please upload only JPG, GIF or PNG photos.', 'buddypress'),42 10 => sprintf( _n( 'Please upload only this file type: %s.', 'Please upload only these file types: %s.', count( $allowed_types ), 'buddypress' ), self::get_avatar_types( $allowed_types ) ), 40 43 ), 41 44 ) ); 45 } 46 47 /** 48 * Gets the available avatar types 49 * 50 * @since BuddyPress (2.3.0) 51 * @return string comma separated list of allowed avatar types 52 */ 53 public static function get_avatar_types( $allowed_types = array() ) { 54 $types = array_map( 'strtoupper', $allowed_types ); 55 $comma = _x( ',', 'avatar types separator', 'buddypress' ); 56 return join( $comma . ' ', $types ); 42 57 } 43 58
Note: See TracChangeset
for help on using the changeset viewer.