Last active
January 2, 2023 17:24
-
-
Save AngeliMae/ee6dc48ab0a2ea57d1cf23d6bd455b20 to your computer and use it in GitHub Desktop.
Support WebP in the Image upload - UM Cover & Profile Photo
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
| // Cover & Profile Photo | |
| add_filter("um_get_field__cover_photo","um_010223_allowed_webp_image_type", 10, 1 ); | |
| add_filter("um_get_field__profile_photo","um_010223_allowed_webp_image_type", 10, 1 ); | |
| function um_010223_allowed_webp_image_type( $data ){ | |
| $arr = explode( ",", $data['allowed_types'] ); | |
| $arr[ ] = "webp"; | |
| $data['allowed_types'] = implode(",", $arr); | |
| return $data; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment