Created
October 2, 2019 21:39
-
-
Save hmbashar/17b6ea30a0da370e1fbb08e577008b61 to your computer and use it in GitHub Desktop.
show user id to user main page with a column
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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