How to extend admin users list page?

Below is a image of the WordPress admin user list:

Read More

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?

Related posts

Leave a Reply

2 comments

  1. 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>";
    }