0

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_logger&user=3.

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

1
  • 2
    Can you add the code that you have for now? Commented Jul 26, 2013 at 10:23

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.