Opened 2 years ago

Last modified 4 months ago

#15828 accepted enhancement

Alphabetized My Sites

Reported by: scep Owned by: jakub.tyrcha
Priority: normal Milestone: Future Release
Component: Multisite Version:
Severity: minor Keywords: has-patch needs-testing
Cc:

Description

For installs that have lots of sites it would be easier to browse if the sites are alphabetized. I add the following code to our install after each update. It would be nice if this was the default.

after line 72: reset( $blogs );

	function cmp($a, $b){
		if ($a->blogname == $b->blogname)return 0;
		else return ($a->blogname < $b->blogname) ? -1 : 1;
	}
	uasort($blogs, 'cmp');

Attachments (1)

15828.patch (1.1 KB) - added by jakub.tyrcha 2 years ago.

Download all attachments as: .zip

Change History (4)

comment:1   jane2 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Keywords has-patch needs-testing added
  • Owner set to jakub.tyrcha
  • Status changed from new to accepted

I don't think the original idea is a good solution - get_blogs_of_user is called in several places and doing a sort outside of this function doesn't make any good. Instead, I propose to introduce internal sorting - it looks much better and does a better job. Patch attached. Also, I improved it to allow sorting by every variable, not only the blogname.

This patch needs a refresh, but I like the concept personally.

Note: See TracTickets for help on using tickets.