Created
April 4, 2013 07:30
-
-
Save rambuvn/5308525 to your computer and use it in GitHub Desktop.
allow to edit comment on the articles which are not theirs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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