Hello,
I’m currently using this snippet to require profile images for users:
add_filter(
'hivepress/v1/forms/user_update/errors',
function( $errors, $form ) {
$user = $form->get_model();
if ( $user && ! $user->get_image__id() ) {
$errors[] = 'Please upload a profile picture.';
}
return $errors;
},
100,
2
);
The issue is that users can still remove their profile picture by clicking the ‘X’ button on their profile image. It automatically deletes their photo, and they aren’t required to save their settings.
Is there a way to prevent this? I’ve attached an image of the button below.
Thank you,
Andrew