hummm… do you mean something like this :
function mysite_column_company( $defaults ) {
$defaults['mysite-usercolumn-company'] = __('Company', 'user-column');
$defaults['mysite-usercolumn-otherfield1'] = __('Other field 1', 'user-column');
$defaults['mysite-usercolumn-otherfield2'] = __('Other field 2', 'user-column');
return $defaults;
}
function mysite_custom_column_company($value, $column_name, $id) {
if( $column_name == 'mysite-usercolumn-company' ) {
return get_the_author_meta( 'company', $id );
}
elseif( $column_name == 'mysite-usercolumn-otherfield1' ) {
return get_the_author_meta( 'otherfield1', $id );
}
elseif( $column_name == 'mysite-usercolumn-otherfield2' ) {
return get_the_author_meta( 'otherfield2', $id );
}
}
by the way, you should use get_the_author_meta() instead of get_usermeta() as it is deprecated.
Related Posts:
- How to check if a user is in a specific role?
- Changing Admin Menu Labels
- How to restrict dashboard access to Admins only?
- Admin Page Redirect
- Adding fields to the “Add New User” screen in the dashboard
- Check if user is admin by user ID
- How to add a custom metabox to the Menu Management admin screen?
- How to display the user that published a pending post?
- Custom user role that can only edit specific (non-custom-type) page and all child pages [duplicate]
- Add a button to users.php
- create users to site with specific language
- Make sub menu items a main link in the admin menu using fuctions.php
- Display sortable User meta column in admin panel user’s page
- Hooking into register_admin_color_schemes
- Removing user fields [duplicate]
- wp-admin edit user url wont show up correct url [closed]
- password protected post policy
- Users Unable to Access Dashboard/Posts/Pages
- Stop loading “collaborators” users on add new post or page?
- Distinguish profile user and admin user IDs / get ID of user being edited
- Uncheck the box “Send User Notification” by default on new-user.php
- Detecting all admins that are logged in
- Subscribers become Authors after Upgrade? / Mass Update of Users?
- Stopping user deletion from running on error
- Filter dropdown in users.php “delete user” bulk edit screen
- Add count for new registered user in Users tab
- Users disappeared from wp-admin
- Logout USER form backoffice after 30 minutes of inactivity [closed]
- WP admin user search doesn’t return all users
- Hide username discovery
- How to get Role Subscribe Users on Admin Menu only in Pages in WordPress
- I accidentally deleted an admin user and all their content is now gone from the site. [closed]
- Restrict submitters from wp-admin [duplicate]
- Nickname field isn’t appearing in Admin
- How to allow WordPress updates to only one specific administrator?
- Is there a filter to edit html of user-edit.php
- Create new user from phpMyAdmin
- How do I make it so that the all users page is not a white screen?
- define two login page url
- Newly created user role not displaying on users screen
- How to check if a user is in a specific role?
- On Users (user.php) in wp-admin disable/hide “Bulk Actions” and “Change Role To”
- Login issue with subdomain installs
- Hook into form handle from admin users table
- restrict admin panel sections to users
- CSRF attack to create USER
- How to keep the plugin submenu open on viewing a custom version of users.php?
- Cannot login in WordPress even after changing hash password in phpmyadmin
- WordPress User profile page fields missing
- Anyone Can Register
- Is it possible to tell if a user is logged into WordPress from looking at the cookies which are set?
- Extend user search in the users.php page to allow for searching by role and excluding specified email domains from the “users search” input box
- Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the “users search” input box
- WordPress Users page missing user count next to different types of users
- Searching for a custom meta from user.php in the admin
- Can a user submit requests to wp-admin/admin.php without logging in?
- wp-admin redirects to 404
- Generate PDF using tcpdf from WordPress admin side custom page [closed]
- Editor’s role in WP
- Minimum version for WordPress Backbone
- Best way to tell if a comment is from a user?
- Is wp-admin/about.php required? Can i omit it from my website
- can’t access backend while frontend works perfect
- How to add Extra Column of post Status in All post page
- Developer/Designer asking for admin access
- WordPress Child theme fails to override parent theme css
- call wp_insert_user in custom class doesnt work
- WP Admin Login keeps redirecting to login
- Sorting custom post types in edit.php : Post disappear
- Admin menu success message
- referencing the current user in a page i created in wordpress
- Users can login to Website from wp-admin prior to confirmation email
- Change wordpress’ database data using ajax – how to get current user id?
- WordPress Redirects to a cancelled domain, need to change it but can’t get to the admin portal
- get_current_user_id() always return 0 in if else statement
- WordPress Admin Login Issue
- Edit “Not Available” Page
- admin-ajax and external service interaction
- Wp-admin Redirection loop after moving to subdirectory
- Remove menu item dashboard for a unique user
- Reestablishing Automatic and Secure FTP Connection, Primary Domain Change
- Show only childs and grandchilds of certain post in admin
- admin-ajax.php & my wp-admin folder url showing in header
- WordPress logged in but no access to wp-admin
- Changed the path to wp-login and now can’t access WPress dashboard
- Why my login panel has a wrong language?
- Creating another wordpress site as sub-domain of a wordpress site
- Mixed content and expired session issues with SSL and wp-admin
- Limit access to wp-admin but still be able to log in from different locations?
- How to Filter in the “Add Media Popup” to show only “unattached” Media
- Working with post values in the admin panel
- wordpress login blank screen [closed]
- wp-admin blank page after admin login and all security off
- Can a wordpress admin see my failed Login attempts?
- After Upgrade: $user becomes unknown (id: 0) after successful login?
- Redirect users based on their roles, is_admin()
- insert an admin table inside another admin page
- /wp-admin/ – this link showing me “Index of /wp-admin”/ instead of dashboard
- What methods are you using to transfer individual WP site components from one site to another?
- sort by date in users