I am unable to remove the image from CRED edit user form after the image has been uploaded. I can replace that image with another image but can't remove it completely.
Here is a video - hidden link
What am I missing?
Hello,
Thanks for the feedback, I can duplicate the same problem, and have escalated this issue, will update here if there is anything news.
Currently, you can use action hook "cred_save_data" to remove the custom image field value, for example, add below codes into your theme file "functions.php":
add_action('cred_save_data', function($user_id, $form_data){
if ($form_data['id']== 123) // replace 123 with your user form's ID
{
$image_field_slug = 'wpcf-' . 'test-image-1'; // replace test-image-1 with your image field slug
if (!isset($_POST[$image_field_slug]))
{
// delete post meta
delete_user_meta($user_id, $image_field_slug);
}
}
}, 99, 2);
More help:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
Thanks. The workaround works.
I have marked this thread as "Escalated" status, will update here if there is anything news.