Skip Navigation

[Closed] Can I delete an image from my server using a CRED form?

This support ticket is created 7 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 7 years, 3 months ago.

Assigned support staff: Minesh.

Author
Posts
#330550

Can I delete an image from my server using a CRED form?
I make an admin interface where some of the higher ranked users can upload images to our site. The images will go through a series of reviewing, but those which will be rejected are not required to stay on the server, they'd only take up space. Is there a way to delete the rejected images? They will be marked with a rejected tag or something, so I was thinking maybe a loop can go over them and delete all of them from the server. Is it possible somehow? Thanks.

#330583

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello and thank you for contacting Toolset support.

You may delete the old images while saving CRED form. When you try to save CRED form you should try to check for available images on server and delete them using unlink.

You may try to use CRED hook 'cred_save_data' to capture save event.
=> https://toolset.com/documentation/user-guides/cred-api/#csd

The topic ‘[Closed] Can I delete an image from my server using a CRED form?’ is closed to new replies.