deadlinkd
Forum Replies Created
-
Hi,
Will be an instant buy if ever you bring this feature to your plugin. Been yearning for something like this in wordpress.
Still, great plugin, keep it up.Cheers,
Deadlinkd/**
* 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
}—————————————————————–
1) Copy the above code in your theme’s function.php file. Should be in public_html/wp-content/themes/your-themes-name/function.php
2) In ultimate member add ‘upload image’ field in registration form.
3) Enter meta key as ‘userphoto’ (i.e same as in the code above)
4) Profit.credits @champsupertramp on github for the code.
Too bad 🙁 Guess i’ll wait before upgrading. Was planning to setup UM on my website since it is advertised as multisite compatible. Anyway, thanks for the prompt response. Much appreciated.
Have a nice day.
D- This reply was modified 8 years, 9 months ago by deadlinkd.