Hey,
Ive been trying to add a new column that displays the users Twitter ID in the wordpress users area.
So far i have this code and the new “Twitter ID” column shows up but not the information and i don’t know why:
add_filter('manage_users_columns', 'twitter_column');
add_action('manage_users_custom_column', 'show_twitter_columns');
function twitter_column($columns) {
$columns['twitter'] = 'Twitter ID';
return $columns;
}
function show_twitter_columns($name) {
global $post;
switch ($name) {
case 'twitter':
$user_info = get_userdata($post->post_author);
echo 'Twitter: ' . $user_info->twitter . "\n";
}
}
If i execute the following code elsewhere in one of the template files the twitter field for the user shows up correctly…
$user_info = get_userdata(3); echo 'Username: ' . $user_info->user_login . "\n"; echo 'User level: ' . $user_info->user_level . "\n"; echo 'User ID: ' . $user_info->ID . "\n"; echo 'Twitter: ' . $user_info->twitter . "\n";
Any ideas to get the column information to show?
Cheers Matt


