[wp-hackers] User who can only moderate comments
Aaron Jorbin
aaron at jorb.in
Thu Mar 3 16:14:02 UTC 2011
you can take the code from
https://code.google.com/p/wp-user-plugins/source/browse/new-role.php
and modify it for your needs. Activate it once and then you'll have
the new role and can deactivate it. You'll want to make changes to the
populate_role_1 function
http://aaron.jorb.in
twitter: twitter.com/aaronjorbin
On Thu, Mar 3, 2011 at 11:10 AM, Blake Baxendell <blake at tayloegray.com> wrote:
> Gaurav,
> Thank you very much for the plug-in. It does work and does what I need.
> I am still looking for a way though to do it in the function.php area
> instead of installing another plug-in into my database. If anyone knows, I
> appreciate the help in advance.
>
> Blake
>
>
>
>
>
> --------- Forwarded message ----------
> From: Gaurav Aggarwal <gaurav91.2008 at gmail.com>
> To: wp-hackers at lists.automattic.com
> Date: Thu, 3 Mar 2011 13:34:48 +0530
> Subject: Re: [wp-hackers] User who can only moderate comments
> Why don't you try http://www.shinephp.com/user-role-editor-wordpress-plugin/
>
> On Thu, Mar 3, 2011 at 3:24 AM, Blake Baxendell <blake at tayloegray.com>
> wrote:
>> I am trying to add a user who can moderate comments but not do anything
> else.
>>
>> I am using the following code, but the user can only see the comments, but
> not approve or mark them as spam. the links are just not there.
>>
>>
>> $_the_roles = new WP_Roles();
>> $_copy_from = 'contributor';
>> $_extra_caps = array(
>> 'moderate_comments' => 1
>> // Each capability you want to grant the new role should
> follow the same format as above
>> // Key = Capability
>> // Value = 1 (grant, 0 would be deny but we don't typically
> add non-granted caps to roles)
>> );
>> $_caps_for_role = array_merge( $_extra_caps,
> (array)$_the_roles->roles[$_copy_from]['capabilities'] );
>>
>> add_role('comment_moderator', 'Comment Moderator', $_caps_for_role
> );
>>
>>
>> I would prefer to do this with a function.php code, not a role scoping
> plugin,
>>
>> thanks in advance,
>>
>> Blake.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list