title: WORDPRESS: Which is fast multiple get_user_meta or custom query to fetch record?
body: <p>I have created the function to get all data of admin information in one shot.</p>
  
  <p>`function get_admin_meta($admin_user_id){</p>
  
  <pre><code>$admin_user_meta        =   array();
  
  $admin_info =   get_userdata( $admin_user_id );
  
  $admin_user_meta['id']              =   (string)$admin_user_id;
  $admin_user_meta['phone_number']                =   get_user_meta ($admin_user_id, 'phone_number', true);
  $admin_user_meta['truck_owner']         =   get_user_meta ($admin_user_id, 'first_name', true);
  $admin_user_meta['full_name']           =   get_user_meta ($admin_user_id, 'first_name', true).' '.get_user_meta ($admin_user_id, 'last_name', true);
  $admin_user_meta['address']     =   get_user_meta ($admin_user_id, 'address', true);    
  $admin_user_meta['city']                =   get_user_meta ($admin_user_id, 'city', true);
  $admin_user_meta['date_of_activation']  =   get_user_meta ($admin_user_id, 'date_of_activation', true);
  $admin_user_meta['payment_amount']      =   get_user_meta ($admin_user_id, 'payment_amount', true);
  $admin_user_meta['next_due_after']      =   get_user_meta ($admin_user_id, 'next_due_after', true);
  $admin_user_meta['status']      =   get_user_meta ($admin_user_id, 'status', true);
  
  $admin_user_meta['insurance_validity']      =   get_user_meta ($admin_user_id, 'insurance_validity', true);
  $admin_user_meta['license_no']      =   get_user_meta ($admin_user_id, 'license_no', true);
  
  $admin_user_meta['profile_pic']     =   '';
  $admin_user_meta['license_pic']='';
  $licensePic=get_user_meta ($admin_user_id, 'license_pic', true);
  if(!empty($licensePic)){
    $admin_user_meta['license_pic']       =   get_template_directory_uri().'/images/user/'.$admin_user_id.'/license/'.$licensePic;
  }
  $profilePic=get_user_meta ($admin_user_id, 'profile_pic', true);
  if(!empty($profilePic)){
    $admin_user_meta['profile_pic']       =   get_template_directory_uri().'/images/user/'.$admin_user_id.'/profile/'.$profilePic;
  } 
  
  return $admin_user_meta;
  </code></pre>
  
  <p>}`</p>
  
  <p>or should I user query </p>
  
  <p>`function get_admin_meta($admin_user_id){</p>
  
  <pre><code>$admin_user_meta        =   array();
  
  //Query
  SELECT * FROM wp_usermeta where user_id=168 and meta_key in ("first_name","last_name","address","city","profile_pic","phone_number","zip_code"); 
  
  //loop fetch data into array with its value
  
  
  //return the association array 
  return $admin_user_meta;
  </code></pre>
  
  <p>}`</p>
  
  <p>Which one is the best method? </p>