intercom-wordpress
intercom-wordpress copied to clipboard
Incorrect Full Name from integration
Plugin uses wp_user->display_name to fill user Name in intercom. But, display name can modified and not always is set as "John Doe". Sometimes display_name uses the first part of user email which causes to set name as john_doe_17, for example.
Suggestion is to use wordpress_user->user_firstname." ".wordpress_user->user_lastname instead os display_name.
Whatever the case, result should be filterable to do whatever is needed.
As a matter of fact, the settings output array might already be filterable, so you could override. @Frisoni have you checked?
Yes, I have know set name correctly with filter, but as an easy to go plugin most customers won't be able to customize using code. I have a lot of incorrect user names in Intercom until I discovered what was going on.
You might have a point - the default should perhaps be not the Display Name.
@Frisoni Would you mind sharing the filter? @lkraav Any timeline for a fix?
It's not really up to me to decide defaults on this project.
@GRSM78 This is the filter to use, BUT it doesn`t work every time. :(
add_filter( 'intercom_settings', function( $settings ) {
$current_user = wp_get_current_user();
if($current_user->id !== 0){
$settings['name'] = ...; // add specific logic to specify the name
}
return $settings;
} );
Have you tried to include a priority? Maybe the reason why it's not working every time is that the original filter is being triggered as well (but later), overwriting yours?