Displaying new user data in user list page
As new fields are added to user profiles, it can be very useful for site administrators to see this data in the site user list and be able to filter users to see only the ones that were assigned certain values. This recipe shows how to add extra columns to the user listing of the WordPress administration area and how to add a filter function to reduce the number of records shown.
Getting ready
You should have already followed the Processing and storing user custom data recipe to have a starting point for this recipe and the resulting plugin should still be active in your development site. Alternatively, you can get the resulting code (Chapter 7/ch2-private-item-text/ch2-private-item-text-v4.php
) from the downloaded code bundle, renaming it ch2-private-item-text.php
.
How to do it...
- Navigate to the
ch2-private-item-text
folder of the WordPress plugin directory of your development installation. - Open the
ch2-private-item-text.php
file in a text editor. - Add...