How can I restrict editors to edit some pages (ID) in my wordpress site? The author can see those pages but should hide edit option. I have tried this snippet but it does not work except hide those pages for author in the list:
function exclude_pages_from_admin($query) {
if (current_user_can( 'author' )) {
global $pagenow,$post_type;
if (is_admin() && $pagenow=='edit.php' && $post_type =='page') {
$query->query_vars['post__not_in'] = array('1068');
}
}
}
add_filter( 'parse_query', 'exclude_pages_from_admin' );