Get user ID when action row link is clicked

I have added an action row link to users.php so that when its clicked it links to a list table.

To generate the data for the clicked user in my custom list table, I need to capture the user ID.

I have all the code working but I don't know how to access the user ID of the user that was clicked.

I am passing the user ID as user via the link so its show in my custom list table url. For example, admin.php?page=history_loggeruser=3.

http://screencast.com/t/ImZgcCUaR this might help.

Topic row-actions wp-list-table users Wordpress

Category Web


I am passing the user ID as user via the link so its show in my custom list table url. For example, admin.php?page=history_logger&user=3

The user ID is in the query variable. You can access it using a PHP global variable. $_GET['user']

$user_id = $_GET['user'];

Do not assume that this request (link) came from the Users Page. You should validate $user_id to be certain it is an integer and a valid user id before operating on it.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.