change of role of a member at the time of connection
-
Hello,
I am looking at the time of the connection of a member to change the role IF it has a role and a specific xprofile field.
The following program end does not work (and no message)add_action('wp_login', 'change2', '99', 2); function change2($user_login, $user) { $user_id = $user->ID; $field_XYZ = 'XYZ'; $XYZ = xprofile_get_field_data($field_XYZ,$bp->loggedin_user->id ); // $user_id ); if ( $user->has_cap('membre1') && ($XYZ='fsdfdsfd')) { .. do_action ... $user_id->add_role( 'membre2' ); } }
Regards
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.