Created
September 21, 2016 06:04
-
-
Save champsupertramp/6b73195db24eb6650a23b4440b4287c3 to your computer and use it in GitHub Desktop.
Ultimate Member - Allow everyone to upload profile and cover photos on front-end pages.
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
/** | |
* Ultimate Member - Customization | |
* Description: Allow everyone to upload profile and cover photos on front-end pages. | |
*/ | |
add_filter("um_user_pre_updating_files_array","um_custom_user_pre_updating_files_array", 10, 1); | |
function um_custom_user_pre_updating_files_array( $arr_files ){ | |
if( is_array( $arr_files ) ){ | |
foreach( $arr_files as $key => $details ){ | |
if( $key == "userphoto" ){ | |
unset( $arr_files[ $key ] ); | |
$arr_files[ "profile_photo" ] = $details; | |
} | |
} | |
} | |
return $arr_files; | |
} | |
add_filter("um_allow_frontend_image_uploads","um_custom_allow_frontend_image_uploads",10, 3); | |
function um_custom_allow_frontend_image_uploads( $allowed, $user_id, $key ){ | |
if( $key == "profile_photo" ){ | |
return true; | |
} | |
return $allowed; // false | |
} |
During upload it’s showing "the image is too large" but actually not a large image at all. I tried many sizes,resulations,formates.
Please help me to fix it.
Thanks in advance
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
This is working fine.
But when updating the ultimate member plugin, user profile picture removed. Please help me.