Skip to content

Instantly share code, notes, and snippets.

@iamchetanp
Created March 8, 2018 21:22
Show Gist options
  • Save iamchetanp/a2653fb12be95167163280eb217bbb29 to your computer and use it in GitHub Desktop.
Save iamchetanp/a2653fb12be95167163280eb217bbb29 to your computer and use it in GitHub Desktop.
Remove capability of moderate comments for editor.
/**
* Remove capability of moderate comments for editor.
*/
function cp_remove_aprove_comment_capability_for_editor() {
// Get the role object.
$editor = get_role( 'editor' );
// Removes capabiity to moderate comments.
$editor->remove_cap( 'moderate_comments' );
}
add_action( 'init', 'cp_remove_aprove_comment_capability_for_editor' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment