Skip to content

Instantly share code, notes, and snippets.

@rambuvn
Created April 4, 2013 07:30
Show Gist options
  • Save rambuvn/5308525 to your computer and use it in GitHub Desktop.
Save rambuvn/5308525 to your computer and use it in GitHub Desktop.
allow to edit comment on the articles which are not theirs
function rb_add_role( $allcaps, $caps, $args ){
global $post;
if( 'edit_comment' == $args[0] ) {
foreach ($caps as $cap) {
if( ! array_key_exists($cap, $allcaps) ) {
$allcaps[$cap] = 1;
}
}
}
return $allcaps;
}
add_filter( 'user_has_cap', 'rb_add_role', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment