mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-05 15:16:59 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user