Skip to main content
Tweeted twitter.com/#!/StackWordPress/status/426114857361211392
added 29 characters in body
Source Link
AndrettiMilas
  • 1.1k
  • 6
  • 26
  • 55

I have a number of pages which are automatically generated. I then use a custom settings box to allow users to exchange the content on those pages.

Problem being, I don't want users to be able to delete these specific pages. One of those pages is the "Disclaimer". The reason I'm doing this is because I'm creating a multi-site legal blog network and each page must have a disclaimer under US laws.

How do I hide these auto-generated pages (like "Disclaimer," below) from the dashboard by title, rather than ID?

// If there is no disclaimer page, generate one from its template
$page = get_page_by_title( 'Disclaimer' );
if(!$page)
{
        wp_insert_post(array(
            'post_name' => 'disclaimer',
            'post_title' => 'Disclaimer',
            'post_status' => 'publish',
            'post_type' => 'page',
            'post_author' => 1,
            'page_template' => 'page-disclaimer.php',
        ));
}

I have a number of pages which are automatically generated. I then use a custom settings box to allow users to exchange the content on those pages.

Problem being, I don't want users to be able to delete these specific pages. One of those pages is the "Disclaimer". The reason I'm doing this is because I'm creating a multi-site legal blog network and each page must have a disclaimer under US laws.

How do I hide these auto-generated pages (like "Disclaimer," below) from the dashboard?

// If there is no disclaimer page, generate one from its template
$page = get_page_by_title( 'Disclaimer' );
if(!$page)
{
        wp_insert_post(array(
            'post_name' => 'disclaimer',
            'post_title' => 'Disclaimer',
            'post_status' => 'publish',
            'post_type' => 'page',
            'post_author' => 1,
            'page_template' => 'page-disclaimer.php',
        ));
}

I have a number of pages which are automatically generated. I then use a custom settings box to allow users to exchange the content on those pages.

Problem being, I don't want users to be able to delete these specific pages. One of those pages is the "Disclaimer". The reason I'm doing this is because I'm creating a multi-site legal blog network and each page must have a disclaimer under US laws.

How do I hide these auto-generated pages (like "Disclaimer," below) from the dashboard by title, rather than ID?

// If there is no disclaimer page, generate one from its template
$page = get_page_by_title( 'Disclaimer' );
if(!$page)
{
        wp_insert_post(array(
            'post_name' => 'disclaimer',
            'post_title' => 'Disclaimer',
            'post_status' => 'publish',
            'post_type' => 'page',
            'post_author' => 1,
            'page_template' => 'page-disclaimer.php',
        ));
}
Source Link
AndrettiMilas
  • 1.1k
  • 6
  • 26
  • 55

Hiding Page by Title from Editing

I have a number of pages which are automatically generated. I then use a custom settings box to allow users to exchange the content on those pages.

Problem being, I don't want users to be able to delete these specific pages. One of those pages is the "Disclaimer". The reason I'm doing this is because I'm creating a multi-site legal blog network and each page must have a disclaimer under US laws.

How do I hide these auto-generated pages (like "Disclaimer," below) from the dashboard?

// If there is no disclaimer page, generate one from its template
$page = get_page_by_title( 'Disclaimer' );
if(!$page)
{
        wp_insert_post(array(
            'post_name' => 'disclaimer',
            'post_title' => 'Disclaimer',
            'post_status' => 'publish',
            'post_type' => 'page',
            'post_author' => 1,
            'page_template' => 'page-disclaimer.php',
        ));
}