Home › Forums › Backend Issues (wp-admin) › Admin users list – new sortable column based on custom field › Reply To: Admin users list – new sortable column based on custom field
Sounds like the value stored in your ‘opiekun_klienta’ field is the user id of the account manager, so there’s just one more step to get the display name (or whichever field you want to show for the managers).
I haven’t tested this, but this should get you close – replace the last function in your code above with:
function column_display_wpse_101322( $value, $column_name, $user_id )
{
$manager_id = get_user_meta( $user_id, 'opiekun_klienta', true );
$manager_name = get_user_meta( $manager_id, 'display_name', true);
if($column_name == 'accountmanager_col') return $manager_name;
return $value;
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.