Unfortunately, the plugin changed hands a few months ago, and it appears the new owners are not responding to support requests in the forum. So, I’m leaving this thread unresolved, in hopes someone can help.
Upon further investigation, I found the culprit within the plugin. It’s the wp_user_avatar settings “allow upload” option. When this is checked, Contributors no longer have access to posts. In fact, in the wp_options table in the WordPress database, if the value for option_name “wp_user_avatar_allow_upload” is “1” (true), the post access vanishes for Contributors. Changing that to “0” (false) restores access.
In the plugin’s file, “includes/class-wp-user-avatar-subscriber.php”, there’s this snippet:
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;
} else {
if(isset($user_roles['subscriber']['capabilities']['edit_posts'])){
unset($user_roles['subscriber']['capabilities']['edit_posts']);
}
}
update_option($wp_user_roles, $user_roles);
}
I tried adding lines for $user_roles['contributor']
, but that had no effect. I also tried commenting this section out altogether, but still, when that plugin option is checked, same result. For now, I’m leaving that option unchecked (false), but it’s nice for users to be able to upload their own avatar via this plugin.
So, not sure how to resolve this problem programmatically. Any suggestions?
-
This reply was modified 4 years, 4 months ago by
jamminjames. Reason: added code found in plugin