Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
public static string Execute()
{
int num1 = 0;
PageDataCollection collection1 = Global.EPDataFactory.GetChildren(Global.EPConfig.Wastebasket, AccessControlList.NoAccess);
foreach (PageData data1 in ((IEnumerable) collection1))
{
if (data1.IsDeleted && (data1.Saved <= DateTime.Now.AddDays(-30)))
{
try
{
Global.EPDataFactory.Delete(data1.PageLink, true, AccessControlList.NoAccess);
num1++;
continue;
}
catch (Exception exception1)
{
EmptyWastebasketJob.?.Error("17.3.1 Error when trying to delete page from recycle bin " + data1.PageLink.ToString(), exception1);
continue;
}
}
}
return string.Format("{0} pages were deleted from recycle bin.", num1);
}
Regards.
/Øyvind (Bob ;D)
EPiServer Norway