manage_users_custom_column
最后更新于:2021-11-27 06:26:49
apply_filters( ‘manage_users_custom_column’, string $output, string $column_name, int $user_id )
Filters the display output of custom columns in the Users list table.
参数
- $output
-
(string)
Custom column output. Default empty. - $column_name
-
(string)
Column name. - $user_id
-
(int)
ID of the currently-listed user.
源文件
文件: gc-admin/includes/class-gc-users-list-table.php
//Adds Custom Column To Users List Table function custom_add_user_id_column($columns) { $columns['user_id'] = 'User ID'; return $columns; } add_filter('manage_users_columns', 'custom_add_user_id_column'); //Adds Content To The Custom Added Column function custom_show_user_id_column_content($value, $column_name, $user_id) { $user = get_userdata( $user_id ); if ( 'user_id' == $column_name ) return $user_id; return $value; } add_filter('manage_users_custom_column', 'custom_show_user_id_column_content', 10, 3);