Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter paulbrian

    (@paulbrian)

    I puchased the plugin last week. It is the perfect solution for an extended medical blog we are building. Steve and Anderson were really helpful in giving advice and went out of their way to get the plugin working nicely with our elementor modules. Highly recommmeded.
    Thanks
    Paul

    Thread Starter paulbrian

    (@paulbrian)

    Try putting this in your functions.php:

    //This action is called whenever Social Login adds a new user
    add_action (‘oa_social_login_action_after_user_insert’, ‘oa_social_login_store_extended_data’, 10, 2);
    function oa_social_login_store_extended_data ($user_data, $identity)
    {
    error_log (print_r ($identity, true)); // to get all fields.
    //Example to store the billing first name:
    update_user_meta ($user_data->id, ‘billing_first_name’, $identity->name->givenName);
    update_user_meta ($user_data->id, ‘billing_last_name’, $identity->name->familyName);
    }

    //Set custom roles for new users
    function oa_social_login_set_new_user_role ($user_role)
    {
    //This is an example for a custom setting with one role
    $user_role = ‘customer’;

    //The new user will be created with this role
    return $user_role;
    }

    //This filter is applied to the roles of new users
    add_filter(‘oa_social_login_filter_new_user_role’, ‘oa_social_login_set_new_user_role’);

Viewing 2 replies - 1 through 2 (of 2 total)