Support

Account

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;
    
    }