Our registration form has a custom field for Hospital Name. In SQL wp_usermeta
the meta_key is user_registration_hospital
. I have tested a number of snippets in the functions.php
file to add a "Hospital" column to the Users admin table, all of which create the Hospital column in the Users list. This is one of the snippets that adds the Hospital column:
function add_user_columns($column) {
$column['hospital'] = 'Hospital';
return $column;
}
add_filter( 'manage_users_columns', 'add_user_columns' );
What code do I need to add to the functions.php file to have the Hospital data from wp_usermeta populate the Hospital column?