- 资源介绍
- 更新记录
- 安装教程
对于开放注册的 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免插件配置SMTP邮件功能教程_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress如何调用最新评论的文章列表_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress细节优化之给文章图片自动添加alt和title信息_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress获取本周/今日/24小时内更新的文章数量_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress自动为新文章添加已使用过的标签_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress如何添加用户自定义上传头像功能_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress正确引入加载JS、css文件的方法_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress列表上下页数字分页导航代码_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress添加网站文章内容页字数统计代码_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress获取文章摘要函数the_excerpt详解_52弹弹堂-5466shop.cn
2020-08-28
-
WordPress在前台添加删除文章功能_52弹弹堂-5466shop.cn
2020-08-28 -
如何WordPress站点添加自定义角色,例如VIP会员用户_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress不用插件实现文章AJAX点赞、文章点赞排行_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress如何调用自定义分类文章数量_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress获取指定/当前分类目录的文章数量_52弹弹堂-5466shop.cn
2020-08-28 -
wordpress主题css适配屏幕尺寸大小自适应教程_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress实现前台登录功能_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress优化之去掉分类链接中的category_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress如何实现给自定类型分类法投稿_52弹弹堂-5466shop.cn
2020-08-28 -
WordPress如何在子分类获取父分类的链接_52弹弹堂-5466shop.cn
2020-08-28
猜你在找
5466资源网 » WordPress 让后台用户列表可以根据文章数进行排序_52弹弹堂-5466shop.cn
- 2020-08-28Hi,初次和大家见面了,请多关照!