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.

  • 2
    Can you add the code that you have for now? – Pontus Abrahamsson Jul 26 '13 at 10:23
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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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