Can anyone help me with adding data to a new User table column that I added?
In the wordpress backend, in the Users section, I added a custom column called “Last Name”. Now, I’d like to add last names to that column.
I’ve looked at this this and this, but nothing has worked.
In my functions.php file, the code below is the closest I’ve gotten to displaying something on the screen, but the problem is that it’s displaying it completely outside of the users list/table (directly above it in fact)
function last_name_value($column_name, $user_id) {
if ( 'lname' == $column_name ) {
echo __('last name here','text-domain');
}
}
add_action('manage_users_custom_column', [$this, 'last_name_value'], 10, 2);
A value of 10 displays ‘last name here’ above the User table (not where I want it obviously), but I should note that it erases all the data in 5 columns for some reason. Any number below 10 and nothing displays.
I’m sure this is really easy, right? What am I doing wrong?