logo

This is an old version of this answer!

Return to the current answer
If you feel ok, you could hack the wordpress core files.
I don't know how to do this in terms of plugin or hooks.

In wp-admin/includes/template.php, function get_column_headers(), find and add this:

$_wp_column_headers[$page] = array(
'cb' => '<input type="checkbox" />',
'username' => __('Username'),
'name' => __('Name'),
'email' => __('E-mail'),
'role' => __('Role'),
'posts' => __('Posts'),
'custom' => 'Custom' /* Add here your custom field Id and Caption */
);
break;


Then find the function user_row() in the same file and add this in the switch-case after the posts case:

case 'posts':
$attributes = 'class="posts column-posts num"' . $style;
$r .= "<td $attributes>";
if ( $numposts > 0 ) {
$r .= "<a href='edit.php?author=$user_object->ID' title='" . __( 'View posts by this author' ) . "' class='edit'>";
$r .= $numposts;
$r .= '</a>';
} else {
$r .= 0;
}
$r .= "</td>";
break;
/*
Your field
*/
case 'custom':
$r .="<td $attributes>Your Values</td>"; /* Here you should retrieve the custom field value associated to the $user_object->ID */
break;


For retrieving the custom field value for each user you can make a raw MySQL query in the custom case
You could use the variable $user_object->ID accessible in the switch-case.

Max | 12/21/09 at 7:18am

This is an old version of this answer!

Return to the current answer