Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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/fred@example.com 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

share|improve this question
    
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. –  Mateusz Hajdziony Nov 17 '12 at 20:28
add comment

2 Answers

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');
share|improve this answer
add comment

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

share|improve this answer
    
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 '12 at 9:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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