function delete_global($id)
{
/**
* Only admin can delete a global album
*/
$super_user_ids = get_super_admins();
if (in_array($this->get_current_author(), array_map('intval', $super_user_ids), true)) {
$default_album = self::get_default();
/**
* Default album is NEVER deleted.
*/
if (intval($id) === $default_album) {
return false;
}
/**
* If a global album is deleted then all the media of that album
* is merged to the default global album and then the album is deleted.
*/
//merge with the default album
$this->merge($default_album, $id);
return $this->delete($id);
} else {
return false;
}
}