adrianmak Posted January 26, 2016 Share Posted January 26, 2016 as title Link to comment Share on other sites More sharing options...
GuruMeditation Posted January 26, 2016 Share Posted January 26, 2016 $pages->delete($page, true) That will also permanently delete any child pages, media items etc. 3 Link to comment Share on other sites More sharing options...
adrian Posted January 26, 2016 Share Posted January 26, 2016 Or if you want via the admin rather than the API per GuruMeditation's suggestion, you could try Nico's module: http://modules.processwire.com/modules/process-page-delete/ In some ways it is obsolete now that the core has a built in trash action button, but it does offer delete/trash options. Keep in mind though that this will only work with the action buttons in the page list view - the "Delete" link in edit mode will still be trash. Otherwise if you really feel the need, you could hook into Pages:trash (https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/core/Pages.php#L1517) and change the behavior to delete instead. BUT, is trashing really so bad? 1 Link to comment Share on other sites More sharing options...
GuruMeditation Posted January 26, 2016 Share Posted January 26, 2016 Or if you want via the admin rather than the API per GuruMeditation's suggestion, you could try Nico's module: http://modules.processwire.com/modules/process-page-delete/ Hang on there sir..... you actually mean to say I got something right on here? There's hope for me yet in the coding world. 2 Link to comment Share on other sites More sharing options...
adrianmak Posted January 27, 2016 Author Share Posted January 27, 2016 Or if you want via the admin rather than the API per GuruMeditation's suggestion, you could try Nico's module: http://modules.processwire.com/modules/process-page-delete/ In some ways it is obsolete now that the core has a built in trash action button, but it does offer delete/trash options. Keep in mind though that this will only work with the action buttons in the page list view - the "Delete" link in edit mode will still be trash. Otherwise if you really feel the need, you could hook into Pages:trash (https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/core/Pages.php#L1517) and change the behavior to delete instead. BUT, is trashing really so bad? In some cases, it is better to delete page instantly. I have pages to store form submission. If I found spam submission, there is no doubt to delete it permanently Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now