I’ve to fetch user data from the usermeta table in wordpress database.fields of the usermeta table are
umeta_id
user_id
meta_key
meta_value
and sm=ome of the meta keys are first_name , last_name
I want to retrieve data from the table based on this meta_key. I am getting data from the user main table using the query given below
$args = array(
'blog_id' => $GLOBALS['blog_id'],
'role' => '',
'meta_key' => '',
'meta_value' => '',
'meta_compare' => '',
'meta_query' => array(),
'include' => array(),
'exclude' => array(),
'orderby' => 'ID',
'order' => 'ASC',
'offset' => '',
'search' => '',
'number' => '',
'count_total' => false,
'fields' => 'all',
'who' => ''
);
// Create the WP_User_Query object
$wp_user_query = new WP_User_Query($args);
what to write if i need the first_name of the user with user id 1
please help me some one
Have you tried to use WordPress get_user_meta() function ?