How do I sort service providers by last name?

How can I sort the service providers by last name? See If you scroll down in the service provider list you will see that it isn't alphabetical (you have to go all the way down).

If you send code, send it all please. I found a similar question and added this question to that one. (See it here: However the code given creates a fatal error. I am sure I am missing something.

  • Michael Bissett

    Hey @wiscwebwriter, hope you're doing well today! :slight_smile:

    In order to sort the names like that inside the admin interface, this would require some custom coding (which would get erased on an update to the plugin), as it's presently designed to display each provider by the ID assigned to him.

    You may need to hire someone to develop this for you, but I can call in our second line support staff, to see if they have a quick way of handling this for you. Like I said earlier though, it would be wiped out on an update to the plugin, so you'd have to note the changes made.

    Please advise,

  • Michael Bissett

    Hey @wiscwebwriter, thanks for your patience here! :slight_smile:

    In that case, I'll call in our second level support staff, to see what they have to say about this.

    Please note, as SLS also develops plugins, and as there is a higher load currently (due to one of them being ill), there may be a slight delay, though they will respond as quickly as possible.

    Hope you're having a great weekend! :slight_smile:

    Kind Regards,

  • Jose

    Hi there @wiscwebwriter,

    This is not possible out of the box, but you can achieve it by doing some simple changes to the templates.

    In this file:
    Change line 11 from this:
    $workers = $appointments->get_workers();
    To this:
    $workers = $appointments->get_workers('name');

    In this other file:
    Change line 7 from this:
    $workers = $wpdb->get_results( "SELECT * FROM " . $appointments->workers_table . " " );
    To this:
    $workers = $appointments->get_workers('name');

    The down side on this change is that you would need to replicate the changes if you update the plugin.

    I'll try to introduce some modifications to the production version in order to make this hookable.

    Please let me know if it works fine for you.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.