C
C
Creel2015-11-25 00:47:36
WordPress
Creel, 2015-11-25 00:47:36

How to delete some in the admin panel on the users page?

How to hide some users from the admin panel?

function test_modify_user_table( $column ) {
    $column['grup'] = 'Группа';	
    return $column;
}
add_filter( 'manage_users_columns', 'test_modify_user_table' );
 
function test_modify_user_table_row( $val, $column_name, $user_id ) {

    if(CTXPS_Queries::check_membership($user_id,2)){
    $grup = 'Тестеры';		
  }else if(CTXPS_Queries::check_membership($user_id,3)){
    $grup = 'Другие';
// тут нужно сделать unset неугодных в $user_object но как?
  }
    switch ($column_name) {
        case 'grup' :
            return $grup;
            break;
        default:
    }
    return $return;
}
add_filter( 'manage_users_custom_column', 'test_modify_user_table_row', 10, 3 );

it turns out that there are many groups, but you need to leave only one or several according to the conditions,
is it really possible to get $user_object and clear unnecessary ones?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
litvin2, 2015-12-04
@litvin2

Make it easier on scripts if you just need to hide.
The checkbox column shows the level of each user. When generating a page, select by class and delete the entire table row.
c339a331e6084eba80433fd55bb0718e.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question