hi Carl,
i have tested the code my side and it works! i will re-attached the code (made a few minor changes). Should work on your side!
So, head back to your themes functions.php file and paste the following code:
<?php
function mod_caps()
{
$editor_role = get_role('editor');
$editor_role->remove_cap('publish_posts');
}
function mod_menu()
{
global $submenu;
$submenu['edit.php'][10][1] = 'publish_posts';
}
function hide_buttons()
{
global $current_screen;
if($current_screen->id == 'edit-post' && !current_user_can('publish_posts'))
{
echo '<style>.add-new-h2{display: none;}</style>';
}
}
function ap_redirect() {
$result = stripos($_SERVER['REQUEST_URI'], 'post-new.php');
if ($result!==false && !current_user_can('publish_posts')) {
wp_redirect(get_option('siteurl') . '/wp-admin/index.php?permissions_error=true');
}
}
function permissions_admin_notice()
{
echo "<div id='permissions-warning' class='error fade'><p><strong>".__('You do not have permission to access that page.')."</strong></p></div>";
}
function showp_notice()
{
if($_GET['permissions_error'])
{
add_action('admin_notices', 'permissions_admin_notice');
}
}
add_action('admin_init','mod_caps');
add_action('admin_init','showp_notice');
add_action('admin_menu','mod_menu');
add_action('admin_menu','ap_redirect');
add_action('admin_head','hide_buttons');
?>
Do note that this includes the editor only. However, the author, and subscriber can be added manually so only admin has access.
I have checked and made sure that all brackets are closed ??
For testing purposes, please do make sure that you disable the role scoper plugin. You can always switch this back on afterwards.
Do let me know the outcome as i will most likely turn this into a plugin.
Good Luck!