WordPress.org

Make WordPress Core

Changeset 4324


Ignore:
Timestamp:
10/04/2006 09:35:25 AM (12 years ago)
Author:
markjaquith
Message:

move plugin sorting (by Name) to get_plugins() so that it works for the Edit Plugins page too. fixes: #2412

Location:
branches/2.0/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-admin/admin-functions.php

    r4230 r4324  
    15711571    }
    15721572
    1573     if (!$plugins_dir || !$plugin_files) {
     1573    if ( !$plugins_dir || !$plugin_files )
    15741574        return $wp_plugins;
    1575     }
    1576 
    1577     sort($plugin_files);
    1578 
    1579     foreach ($plugin_files as $plugin_file) {
     1575
     1576    foreach ( $plugin_files as $plugin_file ) {
    15801577        if ( !is_readable("$plugin_root/$plugin_file"))
    15811578            continue;
     
    15831580        $plugin_data = get_plugin_data("$plugin_root/$plugin_file");
    15841581
    1585         if (empty ($plugin_data['Name'])) {
     1582        if ( empty ($plugin_data['Name']) )
    15861583            continue;
    1587         }
    15881584
    15891585        $wp_plugins[plugin_basename($plugin_file)] = $plugin_data;
    15901586    }
     1587
     1588    uasort($wp_plugins, create_function('$a, $b', 'return strnatcasecmp($a["Name"], $b["Name"]);'));
    15911589
    15921590    return $wp_plugins;
  • branches/2.0/wp-admin/plugins.php

    r4323 r4324  
    8989    $style = '';
    9090
    91     function sort_plugins($plug1, $plug2) {
    92         return strnatcasecmp($plug1['Name'], $plug2['Name']);
    93     }
    94 
    95     uasort($plugins, 'sort_plugins');
    96 
    9791    foreach($plugins as $plugin_file => $plugin_data) {
    9892        $style = ('class="alternate"' == $style|| 'class="alternate active"' == $style) ? '' : 'alternate';
Note: See TracChangeset for help on using the changeset viewer.