Skip to content

Instantly share code, notes, and snippets.

@JiveDig
Forked from noeltock/functions.php
Created July 10, 2014 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JiveDig/359436a7ae0cb2a21c96 to your computer and use it in GitHub Desktop.
Save JiveDig/359436a7ae0cb2a21c96 to your computer and use it in GitHub Desktop.
<?php
function change_author_capabilities() {
$role = get_role( 'author' ) ;
$role->remove_cap( 'edit_published_posts' );
$role->remove_cap( 'publish_posts' );
$role->remove_cap( 'delete_published_posts' );
$role->remove_cap( 'edit_posts' );
$role->remove_cap( 'delete_posts' );
$role->add_cap( 'upload_files' );
$role->add_cap( 'edit_pages' );
$role->add_cap( 'edit_others_pages' );
$role->add_cap( 'edit_published_pages' );
}
add_action( 'admin_init', 'change_author_capabilities' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment