Home > Enterprise >  Show metadata in users.php - wordpress
Show metadata in users.php - wordpress

Time:12-03

is there any way to show metadata in the list of all registered users "users.php"

enter image description here

CodePudding user response:

Add custom column in user.php

function new_modify_user_table( $column ) {
    $column['custom_metadata'] = 'Custom Mtadata';
    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 'custom_metadata' :
            $first_name = get_the_author_meta( 'first_name', $user_id );
            return $first_name;
            break;
        default:
    }
    return $val;
}
add_filter( 'manage_users_custom_column', 'new_modify_user_table_row', 10, 3 );

https://prnt.sc/21ct42s

  • Related