Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: New User Actions for BP


r-a-y
Keymaster

@r-a-y

Just looking into the bp_core_signup_user() function again. Sorry for pointing this to you in the first place!

I would not recommend using this function because it sets a user’s status to “not active”, then sends an email to activate the account (which makes sense because that’s the default registration behavior in BP!).

Since we don’t want to ask a FB user to activate their account, stick with the wp_insert_user() function, then use some code to sync up the xprofile fields like:

// set xprofile field 1 (Name) with the fbuser's first name
xprofile_set_field_data(1,$user_login_id,$fbuser['first_name']);

/*
* @param $field The ID of the field, or the $name of the field.
* @param $user_id The ID of the user
* @param $value The value for the field you want to set for the user.
*/

To initialize BP, look at using the bp_init action:

https://codex.buddypress.org/how-to-guides/checking-buddypress-is-active/

[EDIT]

Just looking into the WP-FB-AutoConnect plugin, Justin (the author) has a do_action that you could hook into:

do_action('wpfb_login', array('WP_ID' => $user_login_id, 'FB_ID' => $fb_uid, 'facebook' => $facebook) );

Here you can sync up your xprofile fields, etc. Unfortunately, this action occurs every time a Facebook user logs in. You could view this as a positive or a negative!

I think it would be nice if Justin added another do_action right after the wp_insert_user() function in _process_login.php.

[EDIT #2]

Requested a new do_action on Justin’s plugin page – http://www.justin-klein.com/projects/wp-fb-autoconnect/comment-page-5#comment-11638.

Skip to toolbar