Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Sort user.php by last name

Discussion in 'Misc WordPress Requests' started by Bluekid, Oct 17, 2017.

  1. Bluekid

    Guest

    Sort user.php by last name, by Bluekid

    Hello friends
    i’ve a problem in admin area exactly about user.php
    i really need to order user list by last name.

    In name list i see name + last name so
    first of all i edited the code for split:

    Line 338 adding array

    protected function get_sortable_columns() {
    $c = array(
    'username' => 'login',
    'lastname' => 'last_name',
    'name' => 'first_name',
    'email' => 'email',
    );

    Line 469 split case name so i can see last name column

    switch ( $column_name ) {
    case 'username':
    $r .= "$avatar $edit";
    break;
    case 'lastname':
    $r .= "$user_object->last_name";
    break;
    case 'name':
    $r .= "$user_object->first_name";
    break;

    So the problem is that if i click on last name sorting indicator the list change always sorting by username. why?
    Can you help me please?

    Sort user.php by last name
     
    #1

Share This Page

Web Hosting