Hello,
I'm having difficulty properly pulling this information over. Here's what I have edited in my theme's function.php
function oa_social_login_store_xprofile ($user_data, $identity)
{
do_action('bp_setup_globals');
xprofile_set_field_data ('First Name', $user_data->ID, $identity->name->givenName);
xprofile_set_field_data ('Last Name', $user_data->ID, $identity->name->familyName);
xprofile_set_field_data ('LinkedIn', $user_data->ID, $identity->profileUrl);
xprofile_set_field_data ('Location', $user_data->ID, $identity->currentLocation);
xprofile_set_field_data ('Bio', $user_data->ID, $identity->aboutMe);
xprofile_set_field_data ('Headline', $user_data->ID, $identity->note);
xprofile_set_field_data ('Email', $user_data->ID, $identity->emails->value);
xprofile_set_field_data ('Organization', $user_data->ID, $identity->organizations->name);
xprofile_set_field_data ('Industry', $user_data->ID, $identity->organizations->industry);
xprofile_set_field_data ('Position', $user_data->ID, $identity->organizations->title);
}
add_action( 'oa_social_login_action_after_user_insert', 'oa_social_login_store_xprofile', 10, 2);
Everything is working perfectly except for the last four - email, organization, industry, and position. What am I doing wrong?
I found the issue. It requires adding [0] after emails and organizations, i.e.:
xprofile_set_field_data ('Email', $user_data->ID, $identity->emails[0]->value);
xprofile_set_field_data ('Organization', $user_data->ID, $identity->organizations[0]->name);
Please sign in to your OneAll account to ask a new question or to contribute to the discussions.
Please click on the link below to connect to the forum with your OneAll account.
Answers
Hi Kenneth,
thank you for the update. Yes emails and organizations are actually lists.
You can find the full structure here:
http://docs.oneall.com/api/basic/identity-structure/
Regards,
Really useful solution for developers working with BuddyPress and LinkedIn data mapping through OneAll. The explanation about arrays and adding [0] makes the integration issue much easier to understand. Keeping track of structured data is important in many systems, including platforms that display the latest news of pakistan where organized content mapping helps show accurate updates and categories properly.
The BISE Multan 1st Year Result is an important update for students who appeared in the HSSC Part-I examinations. Students can check their 11th class marks and subject-wise performance after the official result announcement. The result helps students understand their academic progress and identify subjects that need more attention. Students who achieve good marks can continue their studies with confidence, while those with lower marks can improve their preparation for the 12th class examinations. It is recommended to carefully check the result details and keep a copy for future academic requirements. Regular study and proper revision can help students achieve better results in upcoming examinations.