Advertisement
jesin

28064.diff

Apr 30th, 2014
134
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: wp-admin/includes/class-wp-users-list-table.php
  2. ===================================================================
  3. --- wp-admin/includes/class-wp-users-list-table.php (revision 28050)
  4. +++ wp-admin/includes/class-wp-users-list-table.php (working copy)
  5. @@ -92,8 +92,14 @@
  6.         if ( $this->is_site_users )
  7.             $args['blog_id'] = $this->site_id;
  8.  
  9. -       if ( isset( $_REQUEST['orderby'] ) )
  10. -           $args['orderby'] = $_REQUEST['orderby'];
  11. +       if ( isset( $_REQUEST['orderby'] ) ) {
  12. +           if ( 'name' == $_REQUEST['orderby'] ) {
  13. +               $args['orderby'] = 'meta_value';
  14. +               $args['meta_key'] = 'first_name';
  15. +           } else {
  16. +               $args['orderby'] = $_REQUEST['orderby'];
  17. +           }
  18. +       }
  19.  
  20.         if ( isset( $_REQUEST['order'] ) )
  21.             $args['order'] = $_REQUEST['order'];
  22. Index: wp-admin/includes/class-wp-ms-users-list-table.php
  23. ===================================================================
  24. --- wp-admin/includes/class-wp-ms-users-list-table.php  (revision 28050)
  25. +++ wp-admin/includes/class-wp-ms-users-list-table.php  (working copy)
  26. @@ -50,8 +50,14 @@
  27.             $args['count_total'] = false;
  28.         }
  29.  
  30. -       if ( isset( $_REQUEST['orderby'] ) )
  31. -           $args['orderby'] = $_REQUEST['orderby'];
  32. +       if ( isset( $_REQUEST['orderby'] ) ) {
  33. +           if ( 'name' == $_REQUEST['orderby'] ) {
  34. +               $args['orderby'] = 'meta_value';
  35. +               $args['meta_key'] = 'first_name';
  36. +           } else {
  37. +               $args['orderby'] = $_REQUEST['orderby'];
  38. +           }
  39. +       }
  40.  
  41.         if ( isset( $_REQUEST['order'] ) )
  42.             $args['order'] = $_REQUEST['order'];
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement