I'm using Ultimate Member to replace the profile pages on the forum and everything is working well except I don't know how to let people add a signature to their forum posts.
I know how to create custom fields in UM profile form but how do I connect it to the forum signature?
@anonymous3542, maybe you are familiar with this?
@annabwashere this isn't something I've tried. My thought here would be to create a function that replaces the wpForo signature with the custom field in UM. @robert - any thoughts on this ?
Thanks
Hi @annabwashere, @anonymous3542,
We'll take this into consideration for future releases.
I've just managed to do this with Ultimate Member. I created a custom field on my UM Profile page (entitled "um_forum_signature" and then have this function. I know there are a number of unnecessary lines of code, but I have done that for the benefit of the less technical people I have also working on the website.
add_action('um_user_after_updating_profile', 'my_user_updating_profile_signature', 10, 2);
function my_user_updating_profile_signature($user_id, $args)
{
$userid = $args;
$signature = $user_id['um_forum_signature'];
global $wpdb;
$table = 'wpforo_profiles';
$data = array(
'signature' => $signature,
);
$wpdb->update($table, $data, array('userid' => $userid));
}
It works in terms of functionality but I have not really looked into it from a security perspective.
However, I think you are making this sound more complicated than it actually is. It would probably take me all of 15 minutes (I barely know this stuff and have been figuring it out by Googling, along with repeated trial and error attempts) to:
- ensure that my signature field editor has the same properties as the wpForo signature field
- run the field contents through all the "hard controls" you have in function wpforo_signature
That makes it as secure as using the wpForo field, and with a little more time could probably improve on this by actually using your function directly.
Am I missing something obvious with regards to this being a one direction solution? This solution is only really needed when Replace Forum Profile with Ultimate Member Profile is enabled because the existing integration doesn't support this field.
If for some reason people wanted two profiles at the same time, there is no reason why you couldn't update the other way as well.