@jenny26
Active 8 years, 2 months ago
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
In case anyone’s curious, I ended up changing the following in
bp-core-avatars.php:// If the uploaded image is smaller than the "full" dimensions, throw a warning. if ( $avatar_attachment->is_too_small( $bp->avatar_admin->image->file ) ) { bp_core_add_message( sprintf( __( 'You have selected an image that is smaller than recommended. For best results, upload a picture larger than %d x %d pixels.', 'buddypress' ), bp_core_avatar_full_width(), bp_core_avatar_full_height() ), 'error' ); }Changed to:
// If the uploaded image is smaller than the "full" dimensions, throw a warning. if ( $avatar_attachment->is_too_small( $bp->avatar_admin->image->file ) ) { return false; }I realize changing anything in core files is a terrible idea, but no clue how to make it work otherwise. This basically doesn’t allow uploading any file under minimum dimensions.
I’ve been trying the same thing in
bp-custom.php:function check_avatar_upload() { global $bp; if ( $avatar_attachment->is_too_small( $bp->avatar_admin->image->file ) ) { return false; } } add_action( 'bp_core_pre_avatar_handle_upload', 'check_avatar_upload', 10, 3 );When in
bp-custom.phpthe above results in “HTTP error.” for all uploads. Changing the action tobp_core_avatar_handle_uploadjust uploads everything.Hopefully it helps someone at least a little bit.
Returns “An error occurred. Please try again later.” for all uploads, including legit images.
Viewing 2 replies - 1 through 2 (of 2 total)