Home › Forums › Front End PM PRO › Display the email address instead of the member’s username on the group page
- This topic has 10 replies, 2 voices, and was last updated 2 years, 5 months ago by hamed.
- AuthorPosts
- June 5, 2023 at 7:18 pm #45505hamedParticipant
I want to see members email addresses instead of usernames in the members column on the page that displays the list of groups and members.
Can you give me the solution to do this?Attachments:You must be logged in to view attached files.June 22, 2023 at 11:47 pm #45536Shamim HasanKeymasterPlease add following code in your theme’s (child theme’s if you are using) functions.php
add_filter( 'fep_filter_user_name', function( $name, $id ){ if( is_admin() && ! wp_doing_ajax() ){ $name = fep_get_userdata( $id, 'email', 'id' ); } return $name; }, 10, 2 );June 23, 2023 at 12:06 am #45541hamedParticipantThank you Shamim,
But when I use this code, the list of members completely disappears and even the member’s username is not visible.Attachments:You must be logged in to view attached files.June 23, 2023 at 11:21 am #45545Shamim HasanKeymasterPlease try this code
add_filter( 'fep_filter_user_name', function( $name, $id ){ if( is_admin() && ! wp_doing_ajax() ){ $name = fep_get_userdata( $id, 'user_email', 'id' ); } return $name; }, 10, 2 );June 23, 2023 at 2:49 pm #45547hamedParticipantGreat, thank you.
June 23, 2023 at 2:53 pm #45549hamedParticipantIs it possible to search and add people based on their email address instead of typing and searching for usernames in the new group creation section?
June 23, 2023 at 2:54 pm #45551June 26, 2023 at 11:02 am #45557Shamim HasanKeymasterYou can try following code
add_filter( 'fep_filter_user_name', function( $name, $id ){ if( is_admin() ){ $name = fep_get_userdata( $id, 'user_email', 'id' ); } return $name; }, 10, 2 );June 26, 2023 at 3:27 pm #45559hamedParticipantThank you Shamim, but in the new group creation section, it still searches for the username.
June 26, 2023 at 11:43 pm #45565Shamim HasanKeymasterPlease try following code
add_filter( 'fep_filter_rest_users_args', function( $args ){ $args['search_columns'][] = 'user_email'; return $args; });June 27, 2023 at 4:28 pm #45568hamedParticipantYou are amazing.
Thanks a lot. - AuthorPosts
You need to purchase ‘Front End PM PRO’ to create topic in this support forum.
If you already purchased ‘Front End PM PRO’ please LOGIN.