简体   繁体   English

我们可以在管理员中自定义用户列表视图吗?

[英]Can we customize the users list view in the admin?

I am trying to customize the view of the users list page, i want to display only the rows with the meta value equals to Mycenter . 我试图自定义用户列表页面的视图,我只想显示meta值等于Mycenter I can do it using jQuery but it will no be secure. 我可以使用jQuery来做到这一点,但它并不安全。

Is there any filter to help me do it using php instead? 是否有任何过滤器可以帮助我使用php代替它?

在此处输入图片说明

You can do that using the manage_users_custom_column filter: 您可以使用manage_users_custom_column过滤器执行此操作:

exp: 经验值:

add_filter('manage_users_custom_column',
function($value, $column_name, $user_id) {
    if ( 'center' == $column_name ) {
        if ('Mycenter' == $value) {
           return $value;
        } else {
           return "";
        }
     }
}
, 20, 3);

more info manage_users_custom_column 更多信息manage_users_custom_column

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM