Add other roles/capabilities
-
I’m using the Membership plugin and want to give members the ability to add their own avatars. Their user role is not Contributor or Subscriber but ‘ctmembers’. How can I add this role to the plugin to allow them to add/edit avatars?
They don’t have any post editing capabilities but are able to see premium/membership-only posts.
Right now, custom avatar uploads are only working for Admins/Editors, not our members.
I updated this in class-wp-avatar-user-subscriber.php but it did not work:
public function wpua_subscriber_capability() { global $blog_id, $wpdb, $wpua_allow_upload, $wpua_edit_avatar; $wp_user_roles = $wpdb->get_blog_prefix($blog_id).'user_roles'; $user_roles = get_option($wp_user_roles); if((bool) $wpua_allow_upload == 1 && (bool) $wpua_edit_avatar == 1) { $user_roles['subscriber']['capabilities']['edit_posts'] = true; $user_roles['ctmembers']['capabilities']['read'] = true; } else { unset($user_roles['subscriber']['capabilities']['edit_posts']); unset($user_roles['ctmembers']['capabilities']['read']); } update_option($wp_user_roles, $user_roles); } }
The topic ‘Add other roles/capabilities’ is closed to new replies.