1K 
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 Address Format For a Specific Country in Woocommerce?
- Woocommerce : change menu order in Woo commerce
- How to change the color of an svg element?
- How to Change WooCommerce Coupon Error Messages?
- How to smooth scroll to an id after clicking a link from another page?
- How to change text on addition notes in woo-commerce ?
Post Views: 1,357
