Users List: Modify existing content, manage_users_custom_column
-
Hi,
Iam trying add a user meta city appended to Name column in the users list in admin section. I tried below. If I define a new column City and add content, it displays City column with data. But city do not get displayed along with data in Name column. I am modifying the functions php code. City user meta data has been added for users elsewhere.add_filter('manage_users_columns', 'manage_users_lstcolumns'); function manage_users_lstcolumns($columns) { $columns['name'] = 'Name'; $columns['city'] = 'City'; return $columns; } add_action('manage_users_custom_column', 'manage_users_lstdisplay', 10, 3); function manage_users_lstdisplay($value, $column_name, $user_id) { if ( 'name' == $column_name ) return $value . '<br/>'. get_user_meta('city', $user_id); if ( 'city' == $column_name ) return get_user_meta('city', $user_id); return $value; }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Users List: Modify existing content, manage_users_custom_column’ is closed to new replies.