Get current user’s phone number in wordpress

I want to show current user’s phone number on his profile page. I have used

<?php global $current_user;
get_currentuserinfo();
echo $current_user->user_login;
echo $current_user->user_email;
echo $current_user->user_level;
echo $current_user->user_first-name;
echo $current_user->user_last-name ;
echo current_user->display_name;
echo $current_user->ID;
?>

to get information of user. but when I using

Read More
echo $current_user->user_phone; 

I don’t get the phone number.

How can I get user’s phone number?

Related posts

2 comments

  1. Try this

    <?php 
    $current_user = get_currentuserinfo();
    echo $current_user->user_login;
    echo $current_user->user_email;
    echo $current_user->user_level;
    echo $current_user->user_first-name;
    echo $current_user->user_last-name ;
    echo $current_user->display_name;
    echo $current_user->ID;
    $phone = get_user_meta($current_user->ID,'user_phone',true);
    echo $phone;
    ?>
    
  2. I get the phone number, If anyone need then use

    $user_phone = get_user_meta( $user_id, 'dbem_phone', true ); 
     echo $user_phone;
    

    also get other fields data just get_user_meta( $user_id, ‘field-name’, true );

Comments are closed.