Use the following code to add new column and show data properly.
function add_user_columns_hospital( $column ) {
$column['hospital'] = 'Hospital';
return $column;
}
add_filter( 'manage_users_columns', 'add_user_columns_hospital' );
function modify_user_table_row_hospital( $val, $column_name, $user_id ) {
switch ($column_name) {
case 'hospital' :
return get_the_author_meta( 'user_registration_hospital', $user_id );
default:
}
return $val;
}
add_filter( 'manage_users_custom_column', 'new_modify_user_table_row', 10, 3 );
Related Posts:
- Can I count the number of users matching a value in a multiple value key?
- Save custom user meta on registration
- How to get users by a custom field / by user meta data?
- How do you add a custom option to user data?
- Show User Their Password
- How to update serialized data in the user meta data
- How can I sort get_users() by any value (last_name, user defined fields and more)
- Displaying additional User Contact Information
- get_user_meta Short Profile Section
- Separate table or usermeta
- meta_query for a string inside a meta field containing a comma-separated list
- How to update custom user meta field in wp?
- WordPress User Profile Upload – If page is saved file reset
- ACF: How to get the full field name (meta_key) by a field key?
- How to save multiple options from a dropdown in user profile
- WP_User_Query pulling ACF to loop
- Users Select inside custom metabox
- query usermeta from custom field
- custom avatar removal
- How to add upload video option in wordpress for user?
- Passing args to WP_User_Query am I using meta correctly?
- How to save the date/time of last update of an extra user profile field?
- Show image if author meta (profile fields) exists outside loop
- ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
- How to add fields in custom registration form, validate it and aave to db? [closed]
- check for duplicate user meta data before updating
- Custom Field Repeating When Using foreach
- Increment user meta data by 1 each time a page is visited
- Front-End User Profile
- Get emails from users by custom field SQL
- award points to a user each time they update their cpt post
- How to update user profile custom fields
- Save custom field types with this function…?
- Display Additional Info
- Populate custom checkout fields with data from previous orders
- Add WordPress user custom meta to chartjs vertically stacked chart in Divi theme
- User query – getting values for custom meta keys/fields
- Delete user meta but only if found in array
- How to get data from user meta custom fields created with acf-pro plugin?
- How to save multiple values with same meta_key, each value linked to another tag id
- author.php not showing content if Author has no Posts
- Getting user’s data, by custom field lookup (meta)
- select user with all meta field and field value. I am use Below Query for this ,So any of know another way to fast query instead of below query?
- Redirecting to an external URL
- update_user_meta(): invisible data storage
- Extend WP_User_Query or WP_User to return all custom fields?
- Populate a select box with data stored in the database?
- Create custom fields/meta data gender+country – radiobuttons and dropdown on register screen for these fields
- Custom Meta Boxes and Fields for WordPress: Change directory upload based on user-edit page
- Is it possible in WordPress
- wordpress simple post multi rating with post_meta and user_meta
- How do i get a specific user metadata using custom metavalue outside of wordpress?
- Echo text if field under user_meta is empty with get_users()
- Custom registration form and custom field
- how to add radio field on user meta on function.php?
- Can’t sort custom column on user.php by number / meta_value_num?
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Individual Widgets per Page
- How to add add_meta_box to specific Page Template?
- Apply the_content filter to a custom field with multiple values
- Auto sort the wp-admin post list by a meta key
- Get updated meta data after save_post hook
- TinyMCE in Custom Metabox not loaded after upgrading from WP 3.1.4 to WP 3.2
- How to reload the role specific registration form on validation errors?
- After moving my site from a dev subdomain, to root, all my custom meta data is gone
- Currency (price) formating on custom fields
- Gravity Forms: Create fields programmatically
- all tincymce’s switch when updating page after changing from html to text in custom metabox
- Order by value in serialized custom field
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- Modifying custom order item meta from admin order view
- Customizing WP user profile with custom fields
- Using abs() with custom field in orderby statement
- Can’t save custom field on registration page
- How do I query the title (or handle?) of post meta fieldset (created with Simple Fields Plugin)
- Is it preferable to use custom code to create metaboxes instead of plugins (such as ACF) and if so why? [closed]
- Function that replaces the image in the absence of the post meta
- WP Cli – post add meta in xargs after wp post generate – add multiple fields
- Anyone know how to use ACF and show custom fields for logged in users only on a post? [closed]
- ACF Plugin How to make the customer add more fields in the post?
- custom field in admin columns
- Populate wordpress menu with link to custom field value (file download)
- Users uploaded image and matching an id or taxonomy
- Adding data to User profile
- How can I change author of posts to the value of one of the custom field of the posts?
- Is it possible to add Term Meta Fields to a WooCommerce Attribute?
- Post meta data not showing in frontend, until hitting ‘update’ button
- register_form, custom field not submitted on first try
- How to properly get popular Posts by multiple Values
- Query Custom Fields in Searchform
- Make custom user_meta as permalink for post
- Creating Structured Documents (books) in WordPress?
- Filter query based on date in custom field
- Get custom fields when hover link of post
- Convert many posts from having a specific meta_key to use a post_format
- Custom fields: my custom checkbox area doesn’t seem to work
- Check if a field is capitalized?
- Need to call this php function inside a modal window from text widget
- add multiple values (array) to post meta_input
- Match submitted array fields with the MYSQL database fields to update them correctly in PHP