Mostrar campos de usuario en la columna del administrador

function new_modify_user_table( $column ) {
    $column['test-1'] = 'test 1';
    $column['test-2'] = 'test 2';
    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 'test-1' :
            return get_user_meta($user_id, 'wpcf-test-1', true);
        case 'test-2' :
            return get_user_meta($user_id, 'wpcf-test-2', true);
        default:
    }
    return $val;
}
add_filter( 'manage_users_custom_column', 'new_modify_user_table_row', 10, 3 );

Visto en toolset

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Scroll al inicio

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.