I’m not sure why this isn’t working for you. I would suggest you turn plugin debugging on. This is in the plugin settings under the advanced tab. Once that is on, test the issue, then look in the debugging log to see if there was a problem.
Roland,
nothing specific in the debug log.
Participants_Db::process_form storing record: UPDATE wp_participants_database SET date_updated = NOW(), photo = ‘catarina_2017_klein.jpg’, first_name = ‘Jean’, last_name = ”, address = ”, city = ”, country = ‘France’, zip = ”, phone = ”, email = ”, website = ” WHERE id = 1372
Now when I switch in the settings that the user can delete files and photos, the photo field in the database entry gets deleted (which is what I want) but also the photo itself gets deleted from the upload directory (what I don’t want).
I can of course change the photo for the database entry, but I would like to put no photo for the database entry.
Thank you
I see…well, the only way to allow the user to delete the image from their record but not actually delete the image file is to move or copy the image file to another location.
If you need more control over how images are managed, try the Image Expansion Kit add-on.
Ok I will think about it.
Nevertheless, from a UI point of you, I’d find it more logical to have this red delete checkbox in the record display only in the case the user is allowed to delete, from the plugin settings.
If not he wonders why nothing is happening, even when the checkbox is checked.
Yes, you’re right, it looks like there is a bug here. I was unaware of the problem, so thanks.
The way is is supposed to work is how you want it to work: When the “Allow File Delete” setting is unchecked, the image is deleted from the user’s record, but the file will remain on the server. The delete button is supposed to work in both cases from the user’s perspective.
OK, great. Not a big deal I guess;-)
It should be sufficient to put the IF condition where you check the admin role and the plugin setting which allows the file delete directly before the “delete_file” call.