Skip to content

Instantly share code, notes, and snippets.

@wbcomdev
Created June 22, 2021 14:06
Show Gist options
  • Select an option

  • Save wbcomdev/ee4d072195a3ecf6ec52b00ee2a07cfb to your computer and use it in GitHub Desktop.

Select an option

Save wbcomdev/ee4d072195a3ecf6ec52b00ee2a07cfb to your computer and use it in GitHub Desktop.
<?php
/**
* Sets the size of buddypress profile avatar.
*
* @param int $size size in bytes.
* @param string $type upload type(avatar, cover_upload).
*
* @return int
*/
function wbcom_sets_size_of_bp_avatar( $size, $type ) {
if ( 'avatar' === $type ) {
$size = 20 * 1024; // change size with your own.
}
return $size;
}
add_filter( 'bp_attachments_get_max_upload_file_size', 'wbcom_sets_size_of_bp_avatar', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment