WordPress.org

Make WordPress Core

Ticket #2412: alphabetical_plugins.diff

File alphabetical_plugins.diff, 743 bytes (added by Viper007Bond, 16 years ago)
  • plugins.php

     
    8888<?php
    8989        $style = '';
    9090
    91         function sort_plugins($plug1, $plug2) {
    92                 return strnatcasecmp($plug1['Name'], $plug2['Name']);
     91        // Sort plugins by plugin name
     92        foreach ($plugins as $plugin_file => $plugin_data) {
     93                $plugin_names[] = $plugin_data['Name'];
    9394        }
    94        
    95         uksort($plugins, 'sort_plugins');
     95        $plugin_names = array_map('strtolower', $plugin_names);
     96        array_multisort($plugin_names, SORT_ASC, $plugins);
    9697
    9798        foreach($plugins as $plugin_file => $plugin_data) {
    9899                $style = ('class="alternate"' == $style|| 'class="alternate active"' == $style) ? '' : 'alternate';