// block pages for editor
function menu_redirect() {
$result = false;
$linksToAllow = array(
'index.php',
'edit.php?post_type=page',
'edit.php?post_status=trash&post_type=post',
'edit.php?post_status=trash&post_type=page',
'post-new.php?post_type=page',
'edit.php?page=cms-tpv-page-post',
'post.php',
'edit.php',
'media-new.php',
'upload.php',
'post-new.php'
); // Links to allow
foreach ($linksToAllow as $key=>$value) {
$result = stripos($_SERVER['REQUEST_URI'], $value);
if ($result!==false) {
$result = 'blah';
break;
}
}
if ($result!=='blah') {
$linksToBlock = array(
'/wp-admin/'
); // Links to block
foreach ($linksToBlock as $key=>$value) {
$result = stripos($_SERVER['REQUEST_URI'], $value);
if ($result!==false) {
$result = 'something';
break;
}
}
}
if ($result==something) {
wp_redirect(get_option('siteurl') . '/wp-admin/index.php');
}
}
add_action('admin_menu', 'menu_redirect'); ?>
Panda Recycling b.v. Newsletters | Pandarecycling.com
Panda Recycling b.v. Newsletters
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume you agree. Accept More info