Created
June 22, 2021 14:06
-
-
Save wbcomdev/ee4d072195a3ecf6ec52b00ee2a07cfb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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