Skip to content

Instantly share code, notes, and snippets.

@lynt-smitka
Created January 27, 2019 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lynt-smitka/1169d30b9e08e79c8226d379ae52003c to your computer and use it in GitHub Desktop.
Save lynt-smitka/1169d30b9e08e79c8226d379ae52003c to your computer and use it in GitHub Desktop.
$member = get_role('contributor');
$member->add_cap('edit_published_pages');
$member->add_cap('publish_pages');
function lynt_kill_new() {
if (current_user_can('contributor')) {
global $wp_post_types;
$wp_post_types['page']->cap->create_posts = 'do_not_allow';
}
}
add_action('init','lynt_kill_new');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment