36 lines
1.2 KiB
PHP
36 lines
1.2 KiB
PHP
<?php
|
|
|
|
class Wiaas_Admin_Contacts {
|
|
|
|
public static function init() {
|
|
add_filter( 'manage_users_columns', array(__CLASS__, 'modify_users_screen_table_columns'), 999, 1 );
|
|
|
|
add_filter( 'manage_users_custom_column', array(__CLASS__, 'fill_custom_columns'), 10, 3);
|
|
}
|
|
|
|
public static function modify_users_screen_table_columns( $columns ) {
|
|
|
|
$show_columns = array();
|
|
|
|
$show_columns['cb'] = $columns['cb'];
|
|
$show_columns['username'] = $columns['username'];
|
|
$show_columns['name'] = $columns['name'];
|
|
$show_columns['email'] = $columns['email'];
|
|
$show_columns['phone'] = __( 'Phone', 'wiaas' );
|
|
$show_columns['role'] = $columns['role'];
|
|
$show_columns['wiaas-user-organization'] = $columns['wiaas-user-organization'];
|
|
|
|
return $show_columns;
|
|
|
|
}
|
|
|
|
public static function fill_custom_columns ($empty, $column, $user_id){
|
|
if ($column == 'phone'){
|
|
return get_the_author_meta('phone', $user_id) ?: '-';
|
|
}
|
|
return '';
|
|
}
|
|
|
|
}
|
|
|
|
Wiaas_Admin_Contacts::init(); |