wpf_user_update

wpf_user_update

#Overview
This filter allows you to modify user meta data before it』s sent to your CRM. To use the code examples below, add them to your active theme』s functions.php file.
#Parameters

$user_meta: Array of user meta data, in the format array('meta_field' => 'value').
$user_id: ID for the user being updated.

#Examples
#Save the full URL to a user』s profile photo
If you』re using Ultimate Member to run your site』s membership platform, and want to save a link to the user』s profile photo in your CRM, you』ll find that just syncing the profile_photo field gives you the name of the file, but not the full URL. Using wpf_user_update, we can modify this so the full URL to the user』s profile is sent.
add_filter('wpf_user_update', 'set_profile_photo_url', 10, 2);

function set_profile_photo_url($user_meta, $user_id) {

// Changes "profile_photo.png" to "http://mysite.com/wp-content/uploads/ultimatemember/1/profile_photo.png"
if(isset($user_meta['profile_photo']))
$user_meta['profile_photo'] = content_url() . '/uploads/ultimatemember/' . $user_id . '/' . $user_meta['profile_photo'];

return $user_meta;

}
This filter can be used in a wide variety of ways depending on your particular site』s configuration. For assistance in configuring wpf_user_update for your site contact us and we』d be happy to help.

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注