WordPress.org

Ready to get started?Download WordPress

Forums

How to sort the admin bar's my sites in alphabetical order? (3 posts)

  1. Surbma
    Member
    Posted 3 years ago #

    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!

  2. bitpath
    Member
    Posted 2 years ago #

    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?

  3. Surbma
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags