Remove more create_function calls. props huichen, see #14424.

git-svn-id: https://develop.svn.wordpress.org/trunk@16313 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-11-11 22:50:36 +00:00
parent 19bb470821
commit d8c91db1f4
7 changed files with 67 additions and 15 deletions
+13 -3
View File
@@ -260,7 +260,7 @@ function get_plugins($plugin_folder = '') {
$wp_plugins[plugin_basename( $plugin_file )] = $plugin_data;
}
uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));
uasort( $wp_plugins, '_sort_uname_callback' );
$cache_plugins[ $plugin_folder ] = $wp_plugins;
wp_cache_set('plugins', $cache_plugins, 'plugins');
@@ -312,11 +312,21 @@ function get_mu_plugins() {
if ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php') <= 30 ) // silence is golden
unset( $wp_plugins['index.php'] );
uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));
uasort( $wp_plugins, '_sort_uname_callback' );
return $wp_plugins;
}
/**
* Callback to sort array by a 'Name' key.
*
* @since 3.1.0
* @access private
*/
function _sort_uname_callback( $a, $b ) {
return strnatcasecmp( $a['Name'], $b['Name'] );
}
/**
* Check the wp-content directory and retrieve all drop-ins with any plugin data.
*
@@ -353,7 +363,7 @@ function get_dropins() {
$dropins[ $plugin_file ] = $plugin_data;
}
uksort( $dropins, create_function( '$a, $b', 'return strnatcasecmp( $a, $b );' ));
uksort( $dropins, 'strnatcasecmp' );
return $dropins;
}