Below is a image of the WordPress admin user list:
All I want to do is add an extra column called add badges. Column value should be a link to a another page.
I tried editing core files but it ended up realizing it's a bad practice since, because if I make changes I will lose the changes with the next update.
What WordPress does is that it uses $wp_list_table = _get_list_table('WP_Users_List_Table');
to get the table and $wp_list_table->display();
to display the table.
How to add a field to the table and to extend the admin users list page?
You need the filters manage_users_columns
and manage_users_custom_column
.
Code from Showing user ID on user main page from screen options:
add_filter( 'manage_users_columns', 'column_register_wpse_101322' );
add_filter( 'manage_users_custom_column', 'column_display_wpse_101322', 10, 3 );
function column_register_wpse_101322( $columns )
{
$columns['uid'] = 'ID';
return $columns;
}
function column_display_wpse_101322( $empty, $column_name, $user_id )
{
if ( 'uid' != $column_name )
return $empty;
return "<strong>$user_id</strong>";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With