0

Hope you can assist.

Background:

I have a multisite config. Users need to be able to update their profile from the frontend, via their profile page, which is something like, http://example.com/forum/user/[email protected] thanks to bbpress.

However only Super-Admins can edit their profile. There is a little edit link next to their name but if they are not super-admins then it does not work. How can I fix this?

Thanks in advance

1
  • What happens if you visit the user edit URL manually? Can you edit your profile? It sounds like there is a wrong capability check applied to displaying the edit link. If made a bbPress theme recently and everything seems to be alright on bbPress' side. Nov 17, 2012 at 20:28

2 Answers 2

1

Only super users can edit profiles in Wordpress Multisite. This is because user profiles are site-independent in multisite. A user has one profile, but may be a member of multiple sites with multiple owners. You can't let one of them screw around with the user's profile...

If you really want to take control of this, you can though. For example, I have a locked down multisite where the users are only ever the members of a single site, and those admins need to be able to run them like an independent installation.

Try adding this to functions.php or maybe creating a plugin, so that you can add it to multiple sites with different themes:

/**
 * Change so site admins can edit user profiles, normally, on a network normally only superadmins can
 */
function custom_admin_users_caps( $caps, $cap, $user_id, $args ){

    foreach( $caps as $key => $capability ){

        if( $capability != 'do_not_allow' )
            continue;

        switch( $cap ) {
            case 'edit_user':
            case 'edit_users':
                $caps[$key] = 'edit_users';
                break;
            case 'delete_user':
            case 'delete_users':
                $caps[$key] = 'delete_users';
                break;
            case 'create_users':
                $caps[$key] = $cap;
                break;
        }
    }

    return $caps;
}
add_filter( 'map_meta_cap', 'custom_admin_users_caps', 1, 4 );
remove_all_filters( 'enable_edit_any_user_configuration' );
add_filter( 'enable_edit_any_user_configuration', '__return_true');
-1

Is there something like current_user_can()... or is_super_admin near the edit link? cus it sounds like it has to be some with Roles abd capabilities

1
  • I have had a look and it seems to be something in the bbpress side of things, playing with the roles and capabilities did not help, it's limited to the super admin
    – uknowit2
    Jun 8, 2012 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.