Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

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