WordPress.org

Ready to get started?Download WordPress

Forums

Nextend Facebook Connect
[resolved] [closed] Feature request: Get user birthday and location (12 posts)

  1. colouro
    Member
    Posted 1 year ago #

    Hey there,

    Please add user birthday from facebook account when user registers to wp account. It would be great to write user meta name where to save the birthday or location :)

    http://wordpress.org/extend/plugins/nextend-facebook-connect/

  2. nextendweb
    Member
    Plugin Author

    Posted 1 year ago #

    Hi!

    Please update to version 1.4.43. Then read this documentation: http://www.nextendweb.com/knowledgebase/question/how-can-i-make-custom-calls-when-a-visitor-log-in-with-facebook-connect

    So you have to register an action to the register/login action and then you can save any user data what you want:

    $user_info = wp_get_current_user();
    update_user_meta( $user_info->ID, 'location', 'here comes the location from facebook');
  3. colouro
    Member
    Posted 1 year ago #

    When I log in with FB connect, it does not update any user meta. What am I doing wrong?

    Added this code in my functions.php:

    function my_fb_login_function($user_profile, $facebook){
    
    	$curr_user = wp_get_current_user();
    
    	if( $curr_user->ID == 1 ) { // Just for admin
    		update_user_meta( $curr_user->ID, 'gender', $user_profile["gender"] );
    	}
    }
    add_action( 'nextend_fb_user_logged_in', 'my_fb_login_function'  );
  4. nextendweb
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry, I forgot something. You have to specify the add_action parameter count.

    add_action( 'nextend_fb_user_logged_in', 'my_fb_login_function',10,2);

    10 is the priority - this is the default
    2 is the number of parameters. I have updated the tutorial.

    One more suggestion:

    if( $curr_user->ID == 1 ) { // Just for admin
    if(isset($user_profile["gender"]) ){
    update_user_meta( $curr_user->ID, 'gender', $user_profile["gender"] );
    }
    }

    This will check if that array key exist or not. This prevent notices :)

    Also I would really appreciate if you could insert your final function(with the user meta fill outs) into our knowledgebase: http://www.nextendweb.com/knowledgebase/48

    Others may user your solution too. Thank you! :)

  5. nextendweb
    Member
    Plugin Author

    Posted 1 year ago #

    Also in version 1.4.45, I have added a new filter, which allow you to get more data from your user. Check this topic for more info: http://www.nextendweb.com/knowledgebase/question/how-can-i-get-extended-facebook-permissions-for-other-fields

  6. colouro
    Member
    Posted 1 year ago #

    Hi :)
    Thank you for your help.
    There is still one problem.
    nextend_fb_user_logged_in - not working.
    but the same code with nextend_fb_user_account_linked actions works fine.

    what could we do?

  7. nextendweb
    Member
    Plugin Author

    Posted 1 year ago #

    Do you use with this?

    add_action( 'nextend_fb_user_logged_in', 'my_fb_login_function',10,2 );

    I tried and the login worked for me fine. Also when your account already connected and you logged it and then hit the facebook login again, the action won't get fired. In this case no login happens...

  8. colouro
    Member
    Posted 1 year ago #

    I have found the problem...
    I was trying to get user id before user logs in. The function is called before log in happens... Maybe I could get user ID from your plugin within $user_profile array? In $user_profile array is an ID wich is FB ID. Maybe we can get other ID named wp_id or somehow...
    Then we could update user meta :)

    Thanks!

  9. nextendweb
    Member
    Plugin Author

    Posted 1 year ago #

    You are right! I have modified the calls and added the wp user id parameter. Calls documentation

  10. m615926
    Member
    Posted 6 months ago #

    Hello!
    Thanks for great plugin you developed. I need get more fb user's data and show it in the wordpress backend profile. The knowledge base of Nextend website appears error. I can't find any information about how I complete my needs.
    Could you help me?

    Thanks!

  11. emc666
    Member
    Posted 6 months ago #

    Hello!
    same problem as m615926...
    cannot reach this link
    please help us!

    Thanks!

  12. esmi
    Forum Moderator
    Posted 6 months ago #

    @emc666: If you require assistance then, as per the Forum Welcome, please post your own topic.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic