How to order the service provider list


I´d like to order the Services providers list alphabetically, how can I do it?


  • Jude

    Howdy @luisvid

    Here is the best way to get this done

    jQuery(document).ready(function($) {
    $("select.app_select_workers").append($("select.app_select_workers option").remove().sort(function(a, b) {
        var at = $(a).text(), bt = $(b).text();
        return (at > bt)?1:((at < bt)?-1:0);

    I have put that in a gist for you that you can copy / paste.

    Insert that into either your theme's functions.php, or you can insert it as a mu-plugin.

    To create an mu-plugin, go to your /wp-content/ folder via FTP, and find the folder called "mu-plugins". If there is no folder with that name, then you'll want to create one. Then, create a file inside that folder, and give the file any name you like (making sure the file as an extension of .php, e.g. example.php) and paste the code in there.

    You don't need to activate that plugin, as it will be always be automatically activated. Please be sure to add a PHP start tag at the beginning of the code if you insert this code as a mu-plugin, like this:


    Thank you for being a WPMU DEV member and have a fantastic day!


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.