Support » Plugin: WP Referral Code » Show Invited Email And Contact Like Mobile No

  • Resolved zamorra

    (@zamorra)


    Hi !! , Frist Of All Thank You For Such An Usefull Plugin , Now The Problem Is i Need To Show The Email And Contact Like Mobile No , Address . My Using Ultimate Member Registration I Had Feild Called Mobile No , So When Some One Refer Some One , His Referrer Can See His Email And Contact ( Mobile No , Address , Etc..) , For Example : If Ram Is Referring Vikram , Ram Can See Vikram’s Email And Contact ( Mobile No , Address , Etc… ) , Even You Can This Option In The Invited List Shortcode , Thank You !!

Viewing 8 replies - 1 through 8 (of 8 total)
  • stvsibs

    (@stvsibs)

    wp_referral_code_add_user_to_referrer_invite_list( $user_id, $referrer_id ) where can i add this code please? I need to add already registered users referred by other users

    Thread Starter zamorra

    (@zamorra)

    ok

    Plugin Author shalior

    (@shalior)

    Hey @zamorra, You’re welcome.

    you need a basic snippet to add those extra data.
    something like this, which shows display name in the list.

    add_filter('wp_referral_code_invited_user_text' , function ($user_login, $user_id){
    	// Get user data by user id
    	$user = get_userdata( $user_id );
        // Get display name from user object
    	$display_name = $user->display_name;
        return esc_html( $display_name);
    } , 10, 2);

    I’m not an “Ultimate Member Registration” user so I can’t help you to integrate it with the shortcode.

    Thread Starter zamorra

    (@zamorra)

    Can You Please The Snippet Code To Show Mobile No , Please & Thanks

    Thread Starter zamorra

    (@zamorra)

    IT Is Working , Also I Have Made Some Change , Which Is I Have Replaced All display_name As mobile_number , It Also Worked , But The Problem Is It Shows Only The Mobile No , Not The Username , I Need Username + Mobile No , ( Example : Vimal , 0123456789 ) << Like This It Has To Show In Invited List , Please Check Say , Thanks You !!

    Also This My Code :

    add_filter('wp_referral_code_invited_user_text' , function ($user_login, $user_id){
    	// Get user data by user id
    	$user = get_userdata( $user_id );
        // Get mobile number from user object
    	$mobile_number = $user->mobile_number;
        return esc_html( $mobile_number);
    } , 10, 2);
    • This reply was modified 2 months, 3 weeks ago by zamorra.
    Plugin Author shalior

    (@shalior)

    try this one. ywc. mark the topic as resolved if it’s ok. thanks.

    add_filter('wp_referral_code_invited_user_text' , function ($user_login, $user_id){
    	// Get user data by user id
    	$user = get_userdata( $user_id );
        // Get mobile number from user object
    	$mobile_number = $user->mobile_number ?? '';
        return esc_html( $mobile_number . ', ' . ($user->user_login ?? ''));
    } , 10, 2);
    Thread Starter zamorra

    (@zamorra)

    Thanks It Works

    Thread Starter zamorra

    (@zamorra)

    🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.