How to force buddypress users to complete profile after registration?

Seems logical for any other network, not for buddypress though 🙁

We all know the extended user profiles in buddypress – problem is, even though some fields are marked as required, that “required” seems to have no real significance for buddypress developers. So we have some “required” fields, which nobody EVER asks the user to fill in … “Great” job so far …

Read More

So the question is… how can we force the newly registered user to first fill in all those required fields from the extended user profile, BEFORE he is able to use anything on the site !?

Like he registers with name, prename, email and once he logs in he will be presented with a page/screen where he will have to first complete all the other missing required fileds, before he’ll be able to see ANY content on the site !!?

Anyone please an idea about how to achieve this? It’s more than 1 year I think I search for a solution … 🙁

Related posts

Leave a Reply

4 comments

  1. Use wp_redirect() and admin_url() to redirect the user to his profile page if the custom buddypress user meta data isn’t completely filled.

    From another answer, I’ve seen that there’s the following function: bp_get_profile_field_data(). So you can easily build a template tag, that gives you either the full buddy user meta data set, or simply a FALSE back.

    If you get a FALSE back, then you can redirect the user. On the get_user_metadata-hook, you already got the global $current_user set, so you can do the redirect on the template_redirect-hook.

    function wpse57054_is_buddy_complete( $buddy_user_fields = array() )
    {
        // convert single field keys to arrays
        $buddy_user_fields = (array) $buddy_user_fields;
    
        foreach ( $buddy_user_fields as $buddy_user_meta )
        {
            $data = bp_get_profile_field_data( array( 
                'field'   => $buddy_user_meta,
                'user_id' => wp_get_current_user()->id,
            ) );
            // One field empty/not filled: Abort and return FALSE
            if ( empty( $data ) )
                return false;
        }
    
        // Return the whole data set
        return $data;
    }
    
  2. Sounds like you should instead be putting these fields in the registration page, so that they don’t even get a username or password until they give you this information.

    Otherwise it becomes a pain for both you and the user.

  3. I have just released in the Repository my own plugin, BP Force Profile.

    A plugin to force buddypress users to complete the required fields of their profiles. Each users with a non complete profile are redirecting to their profile page and a notice is displayed with the required fields.