Permissions and Overwriting
-
I am finding that if I, as an admin, upload a profile photo for a contributor, and then that contributor updates their profile, the profile photo is erased.
I believe this is because the permission required for cupp_save_img_meta() is current_user_can(‘edit_user’), a condition which the contributor meets.
However, each of the cupp meta fields are empty so the contributor inadvertently overwrites them to be blank.
I stopped the problem by changing the permission in cupp_save_img_meta() to current_user_can(‘upload_files’). Since the contributor does not have this permission, the fields aren’t overwritten.
Is there a reason the permissions for
cupp_profile_img_fields() and cupp_save_img_meta() are different?https://www.ads-software.com/plugins/custom-user-profile-photo/
- The topic ‘Permissions and Overwriting’ is closed to new replies.