WordPress.org

Support

Support » How-To and Troubleshooting » How to sort the admin bar's my sites in alphabetical order?

How to sort the admin bar's my sites in alphabetical order?

  • Hi,

    I’d like to change the order of the sites in the admin bar. Is there a way to do it?

    Thanks for the help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • HI,
    I found the below solution at http://wordpress.stackexchange.com/questions/35087/need-help-sorting-my-sites-alphabetically

    — begin attempt to paste from site above
    <?php
    /*
    Plugin Name: Sort My-Sites
    Description: Sorts the My Sites listing on both the page and in the 3.3 admin bar dropdown
    Author: Otto
    */

    add_filter(‘get_blogs_of_user’,’sort_my_sites’);
    function sort_my_sites($blogs) {
    $f = create_function(‘$a,$b’,’return strcasecmp($a->blogname,$b->blogname);’);
    uasort($blogs, $f);
    return $blogs;
    }
    — end attempt to paste from site above

    Not sure how to implement it though. Has someone made this a searchable plugin maybe?

    Thank you for your reply! I’m using Hyper Admin plugin now with a little modification to order all the sites for me. It seems easy to use, maybe I will use this code sometime.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to sort the admin bar's my sites in alphabetical order?’ is closed to new replies.