如何过滤用户列表中的views_edit? [英] How to filter views_edit in user list table?
本文介绍了如何过滤用户列表中的views_edit?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下是仪表板中用户列表的屏幕截图.我想自定义突出显示的部分:
The following is a screenshot of the users list table in the dashboard. I'd like to customize highlighted part:
我知道如何使用此WordPress 答案.
我尝试使用过滤器 views_edit-user
但没有任何反应.我也试过用谷歌搜索,但这个过滤器似乎没有文档或者不是真正的 WordPress 过滤器.
I tried to use filter views_edit-user
but nothing happened. I also tried to Google it but it seems this filter doesn't have documentation or is not really a WordPress filter.
如何使用 add_action
或 add_filter
自定义该管理部分?
How to customize that admin section using add_action
or add_filter
?
推荐答案
该屏幕的钩子基于 'views_' .$this->screen->id
,所以应该是:
The hook for that screen is based on 'views_' . $this->screen->id
, so it should be:
add_filter( 'views_users', 'modify_views_users_so_15295853' );
function modify_views_users_so_15295853( $views )
{
// Manipulate $views
return $views;
}
我系统中$views
的内容是:
Array
(
[all] => <a href='users.php' class="current">All <span class="count">(7)</span></a>
[administrator] => <a href='users.php?role=administrator'>Administrator <span class="count">(1)</span></a>
[editor] => <a href='users.php?role=editor'>Editor <span class="count">(1)</span></a>
[subscriber] => <a href='users.php?role=subscriber'>Subscriber <span class="count">(5)</span></a>
)
这篇关于如何过滤用户列表中的views_edit?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文