Last active
June 22, 2021 13:58
-
-
Save wbcomdev/0058013514fbcfcd63b81ce659abc1f2 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 file types for upload BuddyPress User and Group Cover Image. | |
| * | |
| * @param array $exts extensions. | |
| * @param string $type attachment type. | |
| * | |
| * @return array | |
| */ | |
| function wbcom_set_file_type_for_bp_profile_cover_image( $exts, $type ) { | |
| if ( 'cover_image' !== $type ) { | |
| return $exts; | |
| } | |
| $exts = array( 'jpeg', 'png' );// Add your own file types. | |
| return $exts; | |
| } | |
| add_filter( 'bp_attachments_get_allowed_types', 'wbcom_set_file_type_for_bp_profile_cover_image', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment