I'm trying to remove the capability of users other than the admin (ID number 1) to add a page, I know that there are plugins which you can edit the role but in my case I need the users to be 'Administrator' role but I need to remove some capabilities. I have the following code:
function modify_capabilities()
{
global $userdata;
get_currentuserinfo();
$userdata->ID != 1 ->remove_cap('publish_pages');
// for posts it should be:
// $editor_role->remove_cap('publish_posts');
// to add capabilities use add_cap()
}
add_action('admin_init','modify_capabilities');
but I'm not sure why it isn't working. Please help fix the code, thanks
Note: The reason why it needs to be Administrator role because a specific plugin I use only displays reports to 'Administrator'.
[No bumping, thank you.]