Notifications
Clear all

Script [Closed] Unlink user Display Name and About Me

5 Posts
2 Users
0 Reactions
890 Views
Posts: 76
Topic starter
(@hypematrix)
Estimable Member
Joined: 3 years ago

Hello,

Is there away to unlink user Display Name and About Me from the website?

For example when I change the Display Name and About Me section on the forum it also changes it in other places on the website and I would like to keep them separate?

Thanks

4 Replies
Robert
Posts: 10549
Admin
(@robert)
Support Team
Joined: 8 years ago

Hi @motorhype,

I'm sorry, but there is no way to unlink them.

As an alternative solution you can remove the Display Name and About fields from Forum Account fields and prevent them to edit that data. You should put this hook code in the functions.php file of your current WordPress active theme or use the Code Snippet plugin:

function wpforo_custom_remove_user_fields( $fields ){
$remove_fields = array('about', 'display_name');
if( !empty($fields) ){
foreach( $fields as $r => $rows ){
foreach( $rows as $c => $cols ){
foreach( $cols as $f => $field ){
if( $field && in_array($field, $remove_fields) ){
unset($fields[$r][$c][$f]);
}
}
}
}
}
return $fields;
}
add_filter( 'wpforo_get_account_fields', 'wpforo_custom_remove_user_fields');
2 Replies
(@hypematrix)
Joined: 3 years ago

Estimable Member
Posts: 76

@robert

Thank you for getting back to me, I don't really want to remove them.

If I brought the User Custom Fields addon, could I remove the "About Me" section using code and then create a new section similar but call it something else maybe "About"? and then remove "Display Name" with code and make a new section called "Name" and then use code to display is where "Display" Name used to be?

If this would work, could you please provide the code and I will purchase the addon?

Or if you have any other ideas please let me know.

Thanks

(@hypematrix)
Joined: 3 years ago

Estimable Member
Posts: 76

@robert Could you please let me know a.s.a.p because I would like to buy a couple of addons and need to know weather or not to also buy the Custom Fields addon?

Robert
Posts: 10549
Admin
(@robert)
Support Team
Joined: 8 years ago
Posted by: @motorhype

If I brought the User Custom Fields addon, could I remove the "About Me" section using code and then create a new section similar but call it something else maybe "About"? and then remove "Display Name" with code and make a new section called "Name" and then use code to display is where "Display" Name used to be?

No, you cannot. You can remove the Display name, then create new fields, but the new fields will not change the display name in forum posts. Forum posts populate the display name field, they not use any custom fields.

The "About" field can be removed and changed to another field. Just make sure the new field is inserted in both "Profile home" and Account pages.

Next time please use the Pre-Sale Tab or the gVectors Forum for addons related questions. Here we only support the main wpForo plugin.