Adding ‘Website’ field as a Column in the “Users” admin screen
-
Hi guys, quick question.
How would i add a column to show the “Website” field in the main Users admin screen? This way I wont have to click on a username to view their website.I found the following code online, but it obviously needs correcting. Could anyone help me modify it accordingly? (assuming this code is remotely the right one). Thanks!
function new_contact_methods( $contactmethods ) { $contactmethods[‘url’] = ‘Pro’; return $contactmethods; } add_filter( ‘user_contactmethods’, ‘new_contact_methods’, 10, 1 ); function new_modify_user_table( $column ) { $column[‘url’] = ‘Pro’; return $column; } add_filter( ‘manage_users_columns’, ‘new_modify_user_table’ ); function new_modify_user_table_row( $val, $column_name, $user_id ) { switch ($column_name) { case ‘url’ : return get_the_author_meta( ‘url’, $user_id ); break; default: } return $val; } add_filter( ‘manage_users_custom_column’, ‘new_modify_user_table_row’, 10, 3 );
[Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Adding ‘Website’ field as a Column in the “Users” admin screen’ is closed to new replies.