Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to disable create new page option
#12
I've done this small plugin. If activated, when you try to create a page you get redirected to the admin panel's main page.

Code:
<?php
// register plugin
$thisfile = basename(__FILE__, ".php");
register_plugin(
    $thisfile,
    'No New Pages',
    '0.3',
    'Carlos Navarro', '#',
    'Prevents creation of new pages', '', ''
);

add_action('header','nonewpages');

function nonewpages() { ?>
    <style type="text/css">
        #sb_newpage { display:none; }
        #submit_line #dropdown { display:none; }
    </style>
    <?php
    if (basename($_SERVER['PHP_SELF'])=='edit.php') {
        if (!isset($_GET['id'])) {
            global $cookie_redirect;
            redirect($cookie_redirect);
        }
    }
}

// end of file

Copy and save as nonewpages.php in your plugins folder.

Edit, 0.2: I've updated it. Now it also hides the 'create new page' link (in GS 3.1).
Edit, 0.3: Hides dropdown (that allowed creating by cloning an existing page)
Reply


Messages In This Thread
how to disable create new page option - by Connie - 2012-03-04, 04:35:38
how to disable create new page option - by gugu - 2012-03-04, 08:53:59
how to disable create new page option - by Connie - 2012-03-04, 19:13:48
how to disable create new page option - by Carlos - 2012-03-04, 20:57:24
how to disable create new page option - by Connie - 2012-03-04, 22:49:08
how to disable create new page option - by Connie - 2012-03-05, 19:07:37
how to disable create new page option - by Carlos - 2012-03-06, 02:53:12
how to disable create new page option - by Carlos - 2012-03-06, 04:11:18
how to disable create new page option - by gugu - 2012-03-06, 20:58:49
how to disable create new page option - by Carlos - 2012-03-08, 03:18:26
how to disable create new page option - by yojoe - 2012-03-08, 05:53:31
how to disable create new page option - by Connie - 2012-03-08, 06:45:23



Users browsing this thread: 1 Guest(s)