Display the email address instead of the member’s username on the group page


Home Forums Front End PM PRO Display the email address instead of the member’s username on the group page

This topic is: Resolved
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #45505
    hamed
    Participant

    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.
    #45536
    Shamim Hasan
    Keymaster

    Please 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 );
    
    #45541
    hamed
    Participant

    Thank 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.
    #45545
    Shamim Hasan
    Keymaster

    Please 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 );
    
    #45547
    hamed
    Participant

    Great, thank you.

    #45549
    hamed
    Participant

    Is 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?

    #45551
    hamed
    Participant

    I mean in this part.

    Attachments:
    You must be logged in to view attached files.
    #45557
    Shamim Hasan
    Keymaster

    You 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 );
    
    #45559
    hamed
    Participant

    Thank you Shamim, but in the new group creation section, it still searches for the username.

    #45565
    Shamim Hasan
    Keymaster

    Please try following code

    add_filter( 'fep_filter_rest_users_args', function( $args ){
        $args['search_columns'][] = 'user_email';
        return $args;
    });
    
    #45568
    hamed
    Participant

    You are amazing.
    Thanks a lot.

Viewing 11 posts - 1 through 11 (of 11 total)

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.