Skip Navigation

[Resuelto] show the User Fields in Admin Columns

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

Is there a way to show a User Field to the User view as a additional column in the dashboard?

Solution:

There isn't such a built-in feature within Toolset Types plugin.

As a workaround, you can consider custom codes, for example:

https://toolset.com/forums/topic/show-the-user-fields-in-admin-columns/#post-1282799

Relevant Documentation:

https://codex.wordpress.org/Plugin_API/Filter_Reference/manage_users_columns

This support ticket is created hace 5 años, 5 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por alexd-6 hace 5 años, 5 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#1282713

Hey,

i found this solution for my Problem: https://toolset.com/forums/topic/adding-user-field-to-the-admin-users-view-and-ability-to-sort/#post-1282703

But: Yes that is true but it only works with the pro Version of the admin-columns-plugin. - Ist there no way to show the UserFields in AdminColumn of Users?

thx for an answer

alex

#1282799

Dear alex,

Yes, you are right, there isn't such a built-in feature within Toolset Types plugin.

As a workaround, you can consider custom codes, for example:
There are two single line user fields( "test-1" and "test-2"), created with Types plugin, you can try these:

You can add below codes into your them file "functions.php":

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 );

More help:
https://codex.wordpress.org/Plugin_API/Filter_Reference/manage_users_columns
https://codex.wordpress.org/Function_Reference/get_user_meta

#1283737

My issue is resolved now. Thank you!