Skip to content

Instantly share code, notes, and snippets.

@hmbashar
Created October 2, 2019 21:39
Show Gist options
  • Save hmbashar/17b6ea30a0da370e1fbb08e577008b61 to your computer and use it in GitHub Desktop.
Save hmbashar/17b6ea30a0da370e1fbb08e577008b61 to your computer and use it in GitHub Desktop.
show user id to user main page with a column
<?php
// Add Column for user id in user main page
function cb_author_user_id_column( $columns )
{
$columns['uid'] = 'ID';
return $columns;
}
//print suer id to user column
function cb_author_user_id_display_column( $empty, $column_name, $user_id )
{
if ( 'uid' != $column_name )
return $empty;
return '<strong>'.esc_html($user_id).'</strong>';
}
add_filter( 'manage_users_columns', 'cb_author_user_id_column' );
add_filter( 'manage_users_custom_column', 'cb_author_user_id_display_column', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment