Created
June 22, 2021 13:55
-
-
Save wbcomdev/4048fbe3487da4f642959e00fdea5f3c 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 bp profile avatar. | |
| * | |
| * @param array $exts extensions. | |
| * @param string $type attachment type. | |
| * | |
| * @return array | |
| */ | |
| function wbcom_set_file_type_for_bp_profile_avatar( $exts, $type ) { | |
| if ( 'avatar' !== $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_avatar', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment