title: Display user meta data values in admin user list custom columns in WordPress
body: <p>For Woocommerce, with the help of <a href="https://stackoverflow.com/questions/52677584/admin-user-list-custom-column-display-based-on-custom-user-metadata-in-wordpress/52678203?noredirect=1#comment92303706_52678203">this answer thread</a>, I created some custom columns in Back end (Admin) user list:</p>
  
  <p><a href="https://i.stack.imgur.com/jJvQ4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jJvQ4.png" alt="enter image description here"></a></p>
  
  <p>In the database, there are some <code>meta_key</code> values called <code>billing_vatnr</code> and <code>billing_company</code> coming from the WooCommerce registration form and saved in <code>wp_usermeta</code> table.</p>
  
  <p><a href="https://i.stack.imgur.com/GXGKG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GXGKG.png" alt="enter image description here"></a></p>
  
  <p>What I'm trying to figure out is how to display the corresponding <code>meta_value</code> for those meta keys and show them in their respective column for each user. </p>
  
  <p>In other words, in the <strong>VAT Nr</strong> field, the content of the meta key <code>billing_vatnr</code> should be displayed and if there is no content, display <code>N/A</code>. Same for Company Name column with <code>billing_company</code>.</p>
  
  <p>This is what I've tried so far is:</p>
  
  <pre><code>add_filter('manage_users_custom_column',  'vatnr_status_data', 10, 3);
  function vatnr_status_data( $value, $column_name, $user_id ) {
      if ( 'account_vatnr' == $column_name ) {
          if( $billing_vatnr = get_user_meta( $user_id, 'billing_vatnr', true )) {
              echo $billing_vatnr; } else { echo "N/A"; }
      }
      return $value;
  }
  </code></pre>
  
  <p>But it doesn't work.</p>
  
  <p>Here are the different columns I've added:</p>
  
  <pre><code>// creating the columns
  add_action('manage_users_columns','account_verification_status_and_company_columns');
  function account_verification_status_and_company_columns($column_headers) {
      unset($column_headers['posts']);
      $column_headers['account_verification'] = __('Verification Status');
      $column_headers['account_vatnr'] = __('VAT Nr');
      $column_headers['account_companyname'] = __('Company Name');
      return $column_headers;
  }
  
  
  // fetching the verification status, thanks to LoicTheAztec
  add_filter('manage_users_custom_column',  'user_account_verification_status_data', 10, 3);
  function user_account_verification_status_data( $value, $column_name, $user_id ) {
      if ( 'account_verification' == $column_name ) {
          if( get_user_meta( $user_id, 'is_activated', true ) == 1 ) {
              $value = '&lt;span style="color:green;font-weight:bold;"&gt;Verified&lt;/span&gt;';
          } else {
              $value = '&lt;span class="na" style="color:grey;"&gt;&lt;em&gt;Not Verified&lt;/em&gt;&lt;/span&gt;';
          }
      }
      return $value;
  }
  </code></pre>
  
  <p>Any help is very much appreciated.</p>