Hi @testovac,
The BP Attachments Add-on uses the BuddyPress plugin Attachment API which in the end uses wp_handle_upload(). In BuddyPress the image dimensions edit is something we perform for the local avatar feature (in bp_core_avatar_handle_upload()). What we do is replacing the original image, once downloaded, with a cropped one. I understand your need and I believe it can be useful for users but I’m afraid there are no filters/actions to hook to at the best moment to do it with a PHP Snippet. I’ve opened this issue https://github.com/buddypress/bp-attachments/issues/83 and we’ll work on it to make it easier to achieve.
For the second part of your feedback, as I’ve said this Add-on is using the BuddyPress plugin Attachment API. You can control the max upload file size filtering the BuddyPress function bp_attachments_get_max_upload_file_size() when the type is a media for example:
function testovac_attachments_get_max_upload_file_size( $size, $type ) {
if ( 'media' === $type ) {
// 2mb.
$size = 2048000;
}
return $size;
}
add_filter( 'bp_attachments_get_max_upload_file_size', 'testovac_attachments_get_max_upload_file_size', 10, 2 );
I am sorry, but its not works for me (i set 100MB), when i want upload mp4 (71MB) file:
screenshot:
https://ibb.co/m8kdNPf
https://ibb.co/dGThQ58
Is there a plan to do function “set a max limit for each type of file” in the plugin settings?
I have tried to find thousands of tutorials and articles on how to raise wordpress upload options for buddypress but nothing works for me.