对于开放注册的 WordPress 多用户博客而言,我们可能需要了解用户所发布的文章数量,虽然 WordPress 后台的用户列表有“文章”这个列,但是默认是不支持排序的,无法快速查看发布了文章的用户以及他们的文章数量,要解决这个问题,我们只需要将下面的代码添加到主题的 functions.php 即可:
//文章数排序 /* Plugin Name: Sort Users by Post Count Description: Add a column to the Users page in the admin to sort users by post counts.https://github.com/ksemel/sort-users-by-post-count Version: 1.0 Author: Katherine Semel */ if ( ! class_exists('Sort_Users_By_Post_Count') ) { class Sort_Users_By_Post_Count { function Sort_Users_By_Post_Count() { // Make user table sortable by post count add_filter( 'manage_users_sortable_columns', array( $this, 'add_custom_user_sorts' ) ); } /* Add sorting by post count to user page */ function add_custom_user_sorts( $columns ) { $columns['posts'] = 'post_count'; return $columns; } } $Sort_Users_By_Post_Count = new Sort_Users_By_Post_Count(); }
然后,你点击“文章”这个标题,就可以进行排序啦:
WordPress 让后台用户列表可以根据文章数进行排序
「陌客网」 WordPress 让后台用户列表可以根据文章数进行排序 https://www.moke1.cn/853.html


相关文章
猜你喜欢
- 2022年2022年8月6日每日新闻:佩洛西窜访台湾六宗罪 2022-08-17
- 2022年解放军抵近台湾海岸线照片曝光(岛屿军事演习) 2022-08-17
- 2022年长春舰穿越所谓“海峡中线”2022年8月6日最新新闻 2022-08-17
- 2022年这笔账解放军用行动给他们算明白 2022年8月6日最新新闻 2022-08-17
- 2022年中国迈入创新型国家行列 喜报! 2022-08-17
- 2022年台北市搜到30多家山东水饺 网友:这大概就是乡愁的味道吧 2022-08-17
- 2022年鼓励生三孩 17部门联合发文 你怎么看 2022-08-17
- 2022年31省份昨日新增本土“566+2322”(全国疫情最新消息) 2022-08-17
- 2022年全年粮食夺取丰收有支撑(巩固经济回升向好趋势) 2022-08-17
- 卡罗拉仪表盘夜间会亮吗,丰田卡罗拉仪表盘的时间怎么调? 2022-08-17