Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: [INFO] Useful s2member/buddypress knowledge

@shanebp

Moderator

Re: 2. Importing s2member custom fields to buddypress fields
Instead of, for now, editing the codex page, please note the args parameter for add_action.

So the ‘2’ here is the arguments parameter. add_action('wp_login','s2_profile_field_update',10,2);
So the hook provides 2 arguments – very handy & useful.
But your example doesn’t use them in the function s2_profile_field_update.
You can use the $user arg instead of $current_user and thereby get rid of that global.
Use this to see the data in $user:

function hook_arg_display( $user_login, $user ) { 
   var_dump( $user ); 
}
add_action('wp_login','hook_arg_display',10,2);

imo: There is no Option 1.

Skip to toolbar