Is there a way to implement this, that someone can point me towards?

I'd like to setup a node edit form with a button to 'remove all' existing images. Is there an existing function, or best way to approach this, to make sure I find and remove the correct info?

Thanks

Comments

RAFA3L’s picture

Any idea?

quicksketch’s picture

Category: feature » support
Status: Active » Fixed

At this point, we probably won't be adding new features to ImageField module. Code-wise, you simply need to remove the items from the $node object and the corresponding files will be deleted upon calling node_save().

$node = node_load($nid);
$node->field_image = array();
node_save($node);

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.