You are here

function emthumb_clear_field_session in Embedded Media Field 5

2 calls to emthumb_clear_field_session()
emthumb_clear_session in contrib/emthumb/emthumb.module
emthumb_emfield_widget_extra in contrib/emthumb/emthumb.module
when editing a node with an emfield, this will add our custom thumbnail upload form if allowed.

File

contrib/emthumb/emthumb.module, line 499

Code

function emthumb_clear_field_session($fieldname) {
  if (is_array($_SESSION['emthumb'][$fieldname]) && count($_SESSION['emthumb'][$fieldname])) {
    foreach ($_SESSION['emthumb'][$fieldname] as $files) {
      if (is_file($file['filepath'])) {
        file_delete($file['filepath']);
      }
    }
    unset($_SESSION['emthumb'][$fieldname]);
  }
}