Add a column before username in the users profile table
I want to reorder the Company column to be the first column in the table, the code is working fine but it's position is the last one. How can I get it to be in the first before the username?
function add_company_column($defaults) {
$defaults['company'] = __('Company');
return $defaults;
}
function view_company_column($value, $column_name, $id) {
if ($column_name == 'company') {
global $wpdb;
$companyID = get_usermeta($id, 'company');
$company = $wpdb-get_row("SELECT com_name FROM " . $wpdb-prefix . "companies WHERE com_id = " . $companyID);
return $company-com_name;
}
}
add_filter('manage_users_columns', 'add_company_column', 15, 1);
add_action('manage_users_custom_column', 'view_company_column', 15, 3);
Thanks
Topic screen-columns users Wordpress
Category Web