当前位置:首页文章笔记建站教程WordPress 后台用户列表怎么按文章数排序

WordPress 后台用户列表怎么按文章数排序

WordPress 后台用户列表怎么按文章数排序,在当前 WordPress 模板函数文件 functions.php 添加以下代码即可:

  1. //wp后台按文章数排序
  2. /*
  3. Plugin Name: Sort Users by Post Count
  4. 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
  5. Version: 1.0
  6. Author: Katherine Semel
  7. */
  8. if ( ! class_exists(‘Sort_Users_By_Post_Count’) ) {
  9. class Sort_Users_By_Post_Count {
  10. function Sort_Users_By_Post_Count() {
  11. // Make user table sortable by post count
  12. add_filter( ‘manage_users_sortable_columns’, array( $this, ‘add_custom_user_sorts’ ) );
  13. }
  14. /* Add sorting by post count to user page */
  15. function add_custom_user_sorts( $columns ) {
  16. $columns[‘posts’] = ‘post_count’;
  17. return $columns;
  18. }
  19. }
  20. $Sort_Users_By_Post_Count = new Sort_Users_By_Post_Count();
  21. }
温馨提示:

文章标题:WordPress 后台用户列表怎么按文章数排序

文章链接:https://www.wuyanshuo.cn/1347.html

更新时间:2022年09月15日

本站资源均为两层压缩,第一层7z(后缀若为wys,请自行修改为7z)有解压密码;第二层zip或cbz,无解压密码,可直接使用漫画类软件程序查看;详情可参考解压教程

本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:service@wuyanshuo.cn我们将第一时间处理! 资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持。 所有资源仅限于参考和学习,版权归原作者所有,更多请阅读无言说网络服务协议

给TA打赏
共{{data.count}}人
人已打赏
建站教程

the_excerpt() 函数自动调用文章摘要的字数长度

2022-9-15 17:03:16

建站教程

WordPress 怎么禁止评论时存储用户IP地址

2022-9-15 23:00:07

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索
'