Is there a way to delete draft .
Permalink 2 users found helpful
I'm searching a way ( by dashboard or pragramaticaly) to delete all untitled (or not) draft made by the composer ?
Would like to know the same thing.
* Go to Dashboard - Sitemap
* Click on "Include System Pages in Sitemap" (or the checkbox before this text)
* Click the "+" sign before "Drafts" (only is a plus sign if you actually have drafts)
* Click the page and hit "Delete"
* Click on "Include System Pages in Sitemap" (or the checkbox before this text)
* Click the "+" sign before "Drafts" (only is a plus sign if you actually have drafts)
* Click the page and hit "Delete"
Hi, thanks for your reply.
I do know where to delete it, the problem is that you have to delete the drafts 1 at a time.
I had around 20+ drafts and wanted to delete them all together at once. (C5 version 5.6.3.3)
I do know where to delete it, the problem is that you have to delete the drafts 1 at a time.
I had around 20+ drafts and wanted to delete them all together at once. (C5 version 5.6.3.3)
Each page has an ID (cID actually). So if you want to remove them by code, you can delete them by this cID. If I'm not mistaken, this can not be done in the dashboard - removing multiple at once that is. Perhaps there's an add-on on the marketplace or someone who can make that.
@sebastienj
@studio4graphics
I tried this and it works.
- it gets all the page drafts
- each page draft gets moved to the trash
@studio4graphics
I tried this and it works.
- it gets all the page drafts
- each page draft gets moved to the trash
$pageDrafts = Concrete\Core\Page\Page::getDrafts(); foreach ($pageDrafts as $pageDraft) { $pageDraft->moveToTrash(); }
Thank you MrKDilkington!
Going to look how to implement it in the dashboard.
Going to look how to implement it in the dashboard.
@studio4graphics
I am not positive about this, but I think it needs permission checks if you are going to put it into the dashboard. Otherwise any user can remove all site page drafts.
- a check to see if the user has permission to move the draft to the trash
A per user page draft removal would be even better. Users could only trash their own drafts and admins could trash all of them.
I am not positive about this, but I think it needs permission checks if you are going to put it into the dashboard. Otherwise any user can remove all site page drafts.
- a check to see if the user has permission to move the draft to the trash
A per user page draft removal would be even better. Users could only trash their own drafts and admins could trash all of them.