function delete($id)
{
if (!$id) {
return false;
}
$result = true;
$notices = elgg_get_entities_from_metadata(array('type' => 'object', 'subtype' => 'admin_notice', 'metadata_name' => 'admin_notice_id', 'metadata_value' => $id, 'limit' => false, 'batch' => true, 'batch_inc_offset' => false));
// in case a bad plugin adds many, let it remove them all at once.
foreach ($notices as $notice) {
$result = $result && $notice->delete();
}
return $result;
}