How to add new column in user listing table admin side wordpress

Posted: June 18, 2015 in Uncategorized
Tags: , , , , , , , , ,

add_filter(‘manage_users_columns’, ‘add_cuser_id_column’);
functionadd_cuser_id_column($columns) {
$columns[‘user_id’] = ‘User ID’;
return $columns;
}

add_action(‘manage_users_custom_column’, ‘show_cuser_id_column_content’, 10, 3);
function show_cuser_id_column_content($value, $column_name, $user_id) {
$user = get_userdata( $user_id );
if ( ‘user_id’ == $column_name )
return $user_id;
return $value;
}

Advertisements
Comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s