Okay
  Public Ticket #2666958
Alphabetize author list drop down
Closed

Comments

  •  5
    Earl D started the conversation

    On our calendar implementation we have a bunch of authors due to running a community site as well and the change author drop down list isn’t sorted by username which makes it really challenging to find a user when trying to change the author of an event. 

    Anyway to change that?

  •  878
    Zhivko replied

    Hi,

    The users list by default is ordered by user's last name.

    To change it to first name open file 

    stachethemes_event_calendar\view\admin\events\index.php

    lines 82 and 95

    Edit:

    $users = get_users(array('fields' => array('display_name', 'user_email', 'ID'), 'orderby' => 'meta_value', 'meta_key' => 'last_name'));

    to:

    $users = get_users(array('fields' => array('display_name', 'user_email', 'ID'), 'orderby' => 'meta_value', 'meta_key' => 'first_name'));

    Stachethemes Developer

  •  5
    Earl D replied

    Where is that located?  Also could that possibly be an option to sort by username alphabetical in the future? 

  •  878
    Zhivko replied

    The full path to the file is [your-wordpress-folder]/wp-content/plugins/stachethemes_event_calendar/view/admin/events/index.php

    I guess I could add filter there so it would be easier to modify the order list.


    Stachethemes Developer

  •  5
    Earl D replied

    great I found it thanks and thanks for the filter in advance should you be able to add in a future update

  •  878
    Zhivko replied

    Yes, ofcourse. I can even send you the new index.php file (wp-content/plugins/stachethemes_event_calendar/view/admin/events/index.php).

    Then you can use the filter in your theme/child-theme functions.php files:

    add_filter('stec_addedit_user_list_filter_by', function(){
       return 'first_name'; 
    });

    Stachethemes Developer