Ultimate Facebook callback?

Hi,

I wanted to ask how I can do a callback when logging in with Facebook? I'm using CubePoints plugin and I'd like to reward the user for using facebook login. If they login and it's successful, I would like to add points to their new useraccount.

  • Vladislav
    • Dead Eye Dev

    Hello,

    The latest plugin release (v2.6, just released) will trigger an action hook on every successful user login. The new action is named "wdfb-login-facebook_login", and the functions attached to it are passed the logged in user's ID and the associated Facebook user object.

  • Vladislav
    • Dead Eye Dev

    Hi,

    Perhaps I misunderstood the intention of the code? The actual login is done as one- or optionally two-step action, depending on whether the existing user has already been associated with a Facebook identity. If (s)he has been, the "wdfb-login-facebook_login" hook will be triggered, with the corresponding user ID. This is what happens on user *login* - however, not on the user auto-registration path. Is this perhaps what you had in mind?

  • clin
    • WPMU DEV Initiate

    I guess it'll be better to explain what I'm trying to do. To give users incentive to login via Facebook, I'm giving them 100 points via the cubepoints module. Below is the code I have. I wanted to run the function that adds points manually and it asks for the user id and the point amount

    function mh_add_points_on_fb_login($user_id,$fbuser) {
    	cp_alterPoints($user_id, 100);
    	cp_log('fb_login', $user_id, 100, 'Facebook Login');
    }
    add_action('wdfb-login-facebook_login','mh_add_points_on_fb_login');

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.