Eliminate some of our last remaining create_function() instances
* Moved some into private function callbacks * Eliminated some that weren't necessary anymore props obenland, markjaquith, nacin. fixes #14424 Built from https://develop.svn.wordpress.org/trunk@27373 git-svn-id: http://core.svn.wordpress.org/trunk@27222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -15,11 +15,28 @@
|
||||
*/
|
||||
function get_importers() {
|
||||
global $wp_importers;
|
||||
if ( is_array($wp_importers) )
|
||||
uasort($wp_importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);'));
|
||||
if ( is_array( $wp_importers ) ) {
|
||||
uasort( $wp_importers, '_uasort_by_first_member' );
|
||||
}
|
||||
return $wp_importers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts a multidimensional array by first member of each top level member
|
||||
*
|
||||
* Used by uasort() as a callback, should not be used directly.
|
||||
*
|
||||
* @since 2.9.0
|
||||
* @access private
|
||||
*
|
||||
* @param array $a
|
||||
* @param array $b
|
||||
* @return int
|
||||
*/
|
||||
function _uasort_by_first_member( $a, $b ) {
|
||||
return strnatcasecmp( $a[0], $b[0] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register importer for WordPress.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user