How to prevent certain pages from being deleted?

(Rob) #1

Does anyone have any ideas on how to prevent certain pages from being deleted?
This is on a MU installation and this would also need to apply to admins of each site. Each subsite needs certain pages to be editable but never be able to be deleted (except for by super admin I guess).

Any idea on how to achieve this? Thought there would be a plugin for this but doesn’t look like it.

(Leland Fiegel) #2

Could you provide some more context?

Why would certain pages be editable, but not delete-able? What if someone who couldn’t delete these pages just emptied them out instead?

(Rob) #3

Good questions.

Well I’ll have some pages that are more like system pages, they need to be there and admin should be able to change SOME of the content.

The first example that comes to mind are custom welcome and exit pages. I have a login and logout redirect plugin that points to custom pages I’ve created called Welcome.php and Exit.php. User logs in and is taken to a custom welcome page, logs out and gets an exit page.

I created custom templates for both these pages so that some content never changes. The exit page might have future events hard coded into the template so the user can’t mess with this. But the admin should be able to go to those pages and fill out the page content which will be their own personalized message and will display on these pages.

About these pages:

  • These system pages have both hard coded content and space available for personalized message.

  • If admin doesn’t fill out a personalized message there’s no problem, other content will show.
    (it’s ok of someone empties out these pages)

  • These pages are required and should never be deleted.

(Jason) #4

Does something like this work? It would need to be tweaked, but the concept is there.

(Rob) #5

Wow @jasontheadams at first glance that looks like exactly what I need. The funny thing is I actually posted on WPMUDEV support forum regarding this and the reply I got didn’t look promising and you found a solution within their support forum.