I would like to require a profile picture instead of option (any).
How can I do this?
Thank you so much!
I can’t get rid of the optional (OPTION) text. How can I make it disappear?
This is a required field and I would like to make sure it does not appear as optional.
Please try this PHP snippet
add_filter(
'hivepress/v1/forms/user_update/errors',
function( $errors, $form ) {
$user = $form->get_model();
if ( $user && ! $user->get_image__id() ) {
$errors[] = 'Please upload the profile image.';
}
return $errors;
},
100,
2
);
add_filter(
'hivepress/v1/forms/user_update',
function( $form ) {
$form['fields']['image']['statuses']['optional'] = null;
return $form;
},
1000
);
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.