916 
Sometimes, we need to add a new column on the users admin screen sortable. In this blog post you will learn how to add custom column in All users menu in the backend. Here is the code that allows to add custom fields. In this example we would add company name as a custom field. You can also change order of columns. You have to paste this full code in functions.php file.
// This function will also allow you to change order of column
function labotrees_modify_user_table ( $column ) {
$column = array(
"cb" => "",
"username" => "Username",
"name" => "Full Name",
"billing_company" => 'Company Name',
"email" => "E-mail",
"role" => "Role"
);
return $column;
}
add_filter( 'manage_users_columns', 'labotrees_modify_user_table' );
function labotrees_modify_user_table_row ( $val, $column_name, $user_id ) {
switch ($column_name) {
case 'billing_company' :
return get_the_author_meta( 'billing_company', $user_id );
default:
}
return $val;
}
add_filter( 'manage_users_custom_column', 'labotrees_modify_user_table_row', 10, 3 );
Result:

You Might Be Interested In
- How to Change WooCommerce Coupon Error Messages?
- 10 SEO Secrets for E-Commerce Website to rank Higher on Search Engine
- How to set tbody height with overflow scroll?
- Woocommerce : change menu order in Woo commerce
- How to change Address Format For a Specific Country in Woocommerce?
- How can you trigger a Bootstrap modal programmatically?
Post Views: 1,241