How to get usermeta meta_key and meta_value
-
Great plugin! However, I am stumped with populating some data within the table. I would like to populate the table with WooCommerce ‘Customers’ and get 2 meta_values from 2 different meta_keys.
So far, I have queried the customers.
My query looks like this:$this->data = $wpdb->get_results( "SELECT * FROM {$table_prefix}usermeta WHERE meta_key = 'billing_phone'", ARRAY_A );
But when I get here:
function column_default($item, $column_name){ switch($column_name){ case 'rating': case 'director': return $item[$column_name]; default: return print_r($item,true); //Show the whole array for troubleshooting purposes } }
Changing case ‘rating’ to case ‘meta_key’ it displays the key ‘billing_phone’, when I need the meta_value of the ‘billing_phone’ which would be 205-xxx-xxxx. I need 2 values, the meta_key of ‘billing_phone’ and ‘billing_first_name’
Can you please help?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘How to get usermeta meta_key and meta_value’ is closed to new replies.