I have content type with Photos ImageField. I need to create some moderation view to show all photos and “delete” link to delete appropriate photo. How can I programmatically delete value from CCK field (in general not only ImageField but any field type)?
I have content type with Photos ImageField. I need to create some moderation view
Share
I assume that since you use the term “CCK” that you are using Drupal 6.
It looks like the Drupal 6 version of the Filefield module has a suitable tidy-up function : filefield_file_delete. If that’s the case, you can call it manually, then delete the file from the system :
This will remove the file from ALL nodes referencing that file and delete it off disk.
If you are looking only to remove the reference from a single node, you can : load the node, unset the appropriate portion of the node object and resave.